Commit 76128e42 authored by Yuxin Wu's avatar Yuxin Wu

ensure global_step var is created in reuse=False

parent cddca55f
......@@ -45,6 +45,7 @@ def get_global_step_var():
scope = tf.get_variable_scope()
assert scope.name == '', \
"Creating global_step_var under a variable scope would cause problems!"
with tf.variable_scope(scope, reuse=False):
var = tf.get_variable(GLOBAL_STEP_OP_NAME, shape=[],
initializer=tf.zeros_initializer,
trainable=False, dtype=tf.int32)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment