I am trying to replicate VGG16 model in keras, the following is my code:
model = Sequential()
model.add(ZeroPadding2D((1,1),input_shape=(3,224,224)))
model.add(C
The accepted answer works. But you can also do the following:
model.add(MaxPooling2D((2, 2), name='block1_pool', data_format='channels_last')
Keras assumes input to be (width, height, channels)
for TensorFlow backend and (channel, width, height)
for Theano backend. Since your input_shape=(3,224,224)
, specifying data_format='channels_last'
should do the trick.