双通道图像的Keras图像增强
我对具有两个通道的图像执行了数据增强。我的数据集格式为双通道图像的Keras图像增强,keras,Keras,我对具有两个通道的图像执行了数据增强。我的数据集格式为(图像编号、图像高度、图像权重、图像通道),其中图像通道=2 在使用datagen(由ImageDataGenerator创建)执行数据扩充时,将生成一条用户警告消息: UserWarning: NumpyArrayIterator is set to use the data format convention "channels_last" (channels on axis 3), i.e. expected either
(图像编号、图像高度、图像权重、图像通道)
,其中图像通道=2
在使用datagen
(由ImageDataGenerator
创建)执行数据扩充时,将生成一条用户警告消息:
UserWarning: NumpyArrayIterator is set to use the data format convention
"channels_last" (channels on axis 3),
i.e. expected either 1, 3 or 4 channels on axis 3.
However, it was passed an array with shape (1, 150, 150, 2) (2 channels).
警告是否意味着数据扩充失败?是否仅对一个通道图像执行此操作?如果是这样,如何对两个通道的图像执行数据增强(这次不是一个通道,然后连接)?这意味着他们不需要两个通道的图像。这是不标准的 标准图像为:
- 1通道:灰度
- 3频道:RGB
- 4频道:RGBA
x, y = theGenerator[someIndex]
绘图x[0]
和其他
如果生成的图像不好,您可以自己使用python生成器或自定义的
keras.utils.Sequence
进行增强 这意味着他们不希望看到双通道图像。这是不标准的
标准图像为:
- 1通道:灰度
- 3频道:RGB
- 4频道:RGBA
x, y = theGenerator[someIndex]
绘图x[0]
和其他
如果生成的图像不好,您可以自己使用python生成器或自定义的keras.utils.Sequence
进行增强