我对具有两个通道的图像执行了数据增强。我的数据集格式化为(image_Numbers, image_height, image_weights, image_channels),其中image_channels = 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).该警告是否意味着数据增强未成功?它只对一个通道的图像执行吗?如果是这样,如何对两个通道的图像执行数据增强(这次不是一个通道,然后进行拼接)?
发布于 2018-11-01 03:46:56
这意味着他们不需要两个通道图像。这是非标准的。
标准图像为:
由于这是一个警告,我们并不真正知道发生了什么。
自己检查这个生成器的输出。
x, y = theGenerator[someIndex]绘制x[0]和其他。
如果生成的图像不好,您可以使用python生成器或自定义keras.utils.Sequence自己进行增强。
https://stackoverflow.com/questions/53088223
复制相似问题