Open fabbrimatteo opened 7 years ago
Thanks for the issue. It seems that .trainable = False freezes the entire model. Also discussed here: https://github.com/fchollet/keras/issues/4510 Can you please elaborate why do you think it should be set for each layer separately?
After setting the flag, do we need to re-compile the model before the parameters can be frozen? Here is a quotation from https://keras.io/getting-started/faq/
How can I "freeze" Keras layers?
Additionally, you can set the trainable property of a layer to True or False after instantiation. For this to take effect, you will need to call compile() on your model after modifying the trainable property
@jacobgil i am confused by the fact that if you run:
model.summary()
before and after the command .trainable=False you can see that the number of trainable parameters does not change.
The line
discriminator.trainable = False
does not stop the discriminator from learning. Replace that types of line with a call at the following function: