0. Error
在使用Keras.layers.convolutional.Convolution2D的时候
- 1
报如下错误:
OverflowError: Range exceeds valid bounds
这是因为Keras配置图片通道顺序错误导致的。上面代码使用图片通道顺序是[channels] [height] [width]
1. Solution:修改图片通道顺序
检查 ~/.keras/keras.json文件
if "image_dim_ordering": is "th" and "backend": "theano", your input_shape must be (channels, height, width)
if "image_dim_ordering": is "tf" and "backend": "tensorflow", your input_shape must be (height, width, channels)
所以,要保证你使用的通道顺序和配置的通道顺序一致
可以通过这样修改:
- 1
- 2