For the following CNN
model = Sequential()
model.add(Convolution2D(64, 3, 3, border_mode=\'same\', input_shape=(3, 256, 256)))
# now model.output_shape == (
It is a problem caused by the setting of input_shape
. In your current setting, you want to input 256x256 with 3 channels. However, Keras thinks you are giving 3x256 image with 256 channels. There several ways to correct it.
Option 1: Change the order in input_shape
Option 2: Specify image_dim_ordering
in your layers
Option 3: Modify the keras configuration file by changing 'tf' to 'th' in your ~/.keras/keras.json