Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix batch normalization during evaluation
This commit solves the bug observed in all previous versions of this code in which validation loss/accuracy are approximately/exactly constant for every epoch and all validation predictions are of the same class. The problem was due to incorrect implementation of batch normalization in two ways. First, tensorflow does not automatically collect the update ops for updating the moving_mean and moving_variance. This is now being done by using slim.learning.create_train_op() instead of native tf.train.Optimizer().minimize() to create the train op. Second, the decay parameter has been decreased from the default 0.999 to 0.95, as with too high of a value batch_norm takes too long to converge on a small dataset. For more information, see tensorflow/tensorflow#1122.
- Loading branch information
Showing
2 changed files
with
16 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters