You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just a quick question, I'm trying to fine tune the VGG16 as suggested in the notebook 2.4. However, I got an error: The shape of the input to "Flatten" is not fully defined (got (None, None, 512). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.. Not sure if anyone can give me a hint on this. My code is shown below:
from keras.applications import VGG16
model = VGG16(include_top=False)
for layer in model.layers:
layer.trainable = False
top_model = Sequential()
top_model.add(Flatten(input_shape=model.output_shape[1:]))
top_model.add(Dense(768, activation='sigmoid'))
top_model.add(Dropout(0.0))
top_model.add(Dense(768, activation='sigmoid'))
top_model.add(Dropout(0.0))
top_model.add(Dense(n_labels, activation='softmax'))
model.add(top_model)
train_model(model,
(X_train_gte5, y_train_gte5),
(X_test_gte5, y_test_gte5), nb_classes)
The text was updated successfully, but these errors were encountered:
Hi,
Just a quick question, I'm trying to fine tune the VGG16 as suggested in the notebook 2.4. However, I got an error:
The shape of the input to "Flatten" is not fully defined (got (None, None, 512). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.
. Not sure if anyone can give me a hint on this. My code is shown below:The text was updated successfully, but these errors were encountered: