I am trying to freeze the free trained VGG16\'s layers (\'conv_base\' below) and add new layers on top of them for feature extracting. I expect to get same prediction result
The top-rated answer does not work. As suggested by Keras official documentation (https://keras.io/getting-started/faq/), it should be performed per layer. Although there is a parameter "trainable" for a model, it is probably not implemented yet. The safest way is to do as follows:
for layer in model.layers:
layer.trainable = False
model.compile()