Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
双通道图像的Keras图像增强_Keras - Fatal编程技术网

双通道图像的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
进行增强