Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align BN trainable behaviour with TF 2.0 #13892

Closed
wants to merge 13 commits into from

Conversation

datumbox
Copy link
Contributor

Summary

TensorFlow 2.0 has changed the behavior of Batch Normalization to be in inference mode when the trainable parameter is set to False. Reference from the documentation:

...in the case of the BatchNormalization layer, setting trainable = False on the layer means that the layer will be subsequently run in inference mode... This behavior has been introduced in TensorFlow 2.0, in order to enable layer.trainable = False to produce the most commonly expected behavior in the convnet fine-tuning use case.

2 years ago, I have submitted a PR (#9965) that changed Keras' BN behaviour to what TF uses tofday but it was not merged. I submit it for reconsideration, hoping we can align the two behaviors.

I'm happy to make changes to the PR to see it getting merged to master.

Related Issues

#9214
#10014
#10045
#11803

@CMCDragonkai
Copy link

CMCDragonkai commented Jul 14, 2020

This only impacts people who are not using tf.keras right?

What about the people using tensorflow.python.keras.*?

@fchollet fchollet closed this Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants