title: Tensorflow save/restore batch norm
body: <p>I trained a model with batch norm in Tensorflow. I would like to save the model and restore it for further using. The batch norm is done by </p>
  
  <pre><code>def batch_norm(input, phase):
      return tf.layers.batch_normalization(input, training=phase)
  </code></pre>
  
  <p>where the phase is <code>True</code> during training and <code>False</code> during testing.</p>
  
  <p>It seems like simply calling </p>
  
  <pre><code>saver = tf.train.Saver()
  saver.save(sess, savedir + "ckpt")
  </code></pre>
  
  <p>would not work well because when I restore the model it first says restored successfully. It also says <code>Attempting to use uninitialized value batch_normalization_585/beta</code> if I just run one node in the graph. Is this related to not saving the model properly or something else that I've missed?</p>