I have trained a model with tensorflow and used batch normalization during training. Batch normalization requires the user to pass a boolean, called is_training, to set whether the model is in training or testing phase.
When the model was trained, is_training was set as a constant as shown below
is_training = tf.constant(True, dtype=tf.bool, name='is_training')
I have saved the trained model, the files include checkpoint, .meta file, .index file, and a .data. I'd like to restore the model and run inference using it.
The model can't be retrained. So, I'd like to restore the existing model, set the value of is_training to False and then save the model back.
How can I edit the boolean value associated with that node, and save the model again?
is_training=tf.Variable..rather than constant - Ishant Mrinalis_trainingneeds to be a tensorflow constant? Can't it be a python bool? Note that changingis_trainingto a python bool should not give errors in restoring the model. - GeertHis_trainingtoFalseafter I load the model, then save it back. So that when it is restored again, the node has valueFalse. - Effective_cellist