我需要增加多通道图像,并希望使用ImageDataGenerator不幸的是,它只支持1,3和4通道图像,我需要更多.是否可以直接编辑site-packages/Keras/preprocessing/image.py添加必要数量的频道?
if x.shape[self.channel_axis] not in {1, 3, 4, XXX}: raise ValueError( 'Expected input to be images (as Numpy array) ' 'following the dimension ordering convention "' + self.dim_ordering + '" ' '(channels on axis ' + str(self.channel_axis) + '), i.e. expected ' 'either 1, 3 or 4 channels on axis ' + str(self.channel_axis) + '. ' 'However, it was passed an array with shape ' + str(x.shape) + ' (' + str(x.shape[self.channel_axis]) + ' channels).')
其中XXX - 是我需要的多个频道.这会破坏什么吗?谢谢!