Getting low test accuracy using Tensorflow batch_norm function
<p>I am using the official Batch Normalization (BN) function (<a href="https://github.com/tensorflow/tensorflow/blob/b826b79718e3e93148c3545e7aa3f90891744cc0/tensorflow/contrib/layers/python/layers/layers.py#L100" rel="noreferrer">tf.contrib.layers.batch_norm()</a>) of Tensorflow on the MNIST data. I use the following code for adding BN:</p>

<pre><code>local4_bn = tf.contrib.layers.batch_norm(local4, is_training=True)
</code></pre>

<p>During testing, I change "is_training=False" in the above line of code and observe only 20% accuracy. However, it gives ~99% accuracy if I use the  above code also for testing (i.e., keeping is_training=True) with a batch size of 100 images. This observation indicates that the <em>exponential moving average and variance</em> computed by <a href="https://github.com/tensorflow/tensorflow/blob/b826b79718e3e93148c3545e7aa3f90891744cc0/tensorflow/contrib/layers/python/layers/layers.py#L100" rel="noreferrer">batch_norm()</a> are probably incorrect or I am missing something in my code.</p>

<p>Can anyone please answer about the solution of the above problem.</p>