Commit 34af79db authored by Mohammad Babaeizadeh's avatar Mohammad Babaeizadeh Committed by GitHub
Browse files

Fixing the initialization/loading bug.

The code currently loads the checkpoint and then initializes the variables resulting to random weights. 
Swapping the order fixes the loading checkpoint issue.
parent fc7342bf
...@@ -204,6 +204,8 @@ def main(unused_argv): ...@@ -204,6 +204,8 @@ def main(unused_argv):
# Make training session. # Make training session.
sess = tf.InteractiveSession() sess = tf.InteractiveSession()
sess.run(tf.global_variables_initializer())
summary_writer = tf.summary.FileWriter( summary_writer = tf.summary.FileWriter(
FLAGS.event_log_dir, graph=sess.graph, flush_secs=10) FLAGS.event_log_dir, graph=sess.graph, flush_secs=10)
...@@ -211,7 +213,6 @@ def main(unused_argv): ...@@ -211,7 +213,6 @@ def main(unused_argv):
saver.restore(sess, FLAGS.pretrained_model) saver.restore(sess, FLAGS.pretrained_model)
tf.train.start_queue_runners(sess) tf.train.start_queue_runners(sess)
sess.run(tf.global_variables_initializer())
tf.logging.info('iteration number, cost') tf.logging.info('iteration number, cost')
......
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