Skip to content

Commit 34af79d

Browse files
authored
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.
1 parent fc7342b commit 34af79d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

video_prediction/prediction_train.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,15 @@ def main(unused_argv):
204204

205205
# Make training session.
206206
sess = tf.InteractiveSession()
207+
sess.run(tf.global_variables_initializer())
208+
207209
summary_writer = tf.summary.FileWriter(
208210
FLAGS.event_log_dir, graph=sess.graph, flush_secs=10)
209211

210212
if FLAGS.pretrained_model:
211213
saver.restore(sess, FLAGS.pretrained_model)
212214

213215
tf.train.start_queue_runners(sess)
214-
sess.run(tf.global_variables_initializer())
215216

216217
tf.logging.info('iteration number, cost')
217218

0 commit comments

Comments
 (0)