stanford-tensorflow-tutorials icon indicating copy to clipboard operation
stanford-tensorflow-tutorials copied to clipboard

07_convnet_layers.py self.training should use tf.placeholder

Open TonyZZX opened this issue 6 years ago • 0 comments

If you use a Python bool, the value of training won't change because you already build the logits before the session and you can't change the graph during the session. The correct way should use tf.placeholder like this: self.training = tf.placeholder(tf.bool, name='is_train') And set sess.run(init, feed_dict={self.is_training: True}) when trainingand sess.run(init, feed_dict={self.is_training: False}) when evalating

TonyZZX avatar Feb 27 '19 03:02 TonyZZX