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
I would expect that, since model2 has been compiled, the output of the two model2.summary() calls would be the same. However, after running the above code the actual output is
In addition, from other experiments I get the feeling that although the number of trainable weights reported by summary() differs in the two cases, the actual number of trainable weights is the expected one, that is, in the example above, even after setting model1.trainable=True, training will really update only 2,112 parameters and not 5,344. So, maybe this is just a reporting issue.
The text was updated successfully, but these errors were encountered:
I get a very similar issue when running the following snippet from the Keras docs. Based on the output of summary(), it seems like even after compiling, the number of trainable parameters changes in both trainable_model and frozen_model depending on whether I set layer.trainable = True or layer.trainable = False.
x = Input(shape=(32,))
layer = Dense(32)
layer.trainable = False
y = layer(x)
alpapado
changed the title
Number of trainable weights seem to change after model compilation
[BUG] Number of trainable weights seem to change after model compilation
Oct 17, 2017
Consider the following scenario
I would expect that, since
model2
has been compiled, the output of the twomodel2.summary()
calls would be the same. However, after running the above code the actual output isIs this the expected behavior?
In addition, from other experiments I get the feeling that although the number of trainable weights reported by
summary()
differs in the two cases, the actual number of trainable weights is the expected one, that is, in the example above, even after settingmodel1.trainable=True
, training will really update only 2,112 parameters and not 5,344. So, maybe this is just a reporting issue.The text was updated successfully, but these errors were encountered: