keras vgg 16 shape error

Viewed 1244

im trying to fit the data with the following shape to the pretrained keras vgg19 model.

image input shape is (32383, 96, 96, 3) label shape is (32383, 17) and I got this error

expected block5_pool to have 4 dimensions, but got array with shape (32383, 17)

at this line

model.fit(x = X_train, y= Y_train, validation_data=(X_valid, Y_valid),
              batch_size=64,verbose=2, epochs=epochs,callbacks=callbacks,shuffle=True)

Here's how I define my model

model = VGG16(include_top=False, weights='imagenet', input_tensor=None, input_shape=(96,96,3),classes=17)

How did maxpool give me a 2d tensor but not a 4D tensor ? I'm using the original model from keras.applications.vgg16. How can I fix this error?

1 Answers
Related