Skip to content

Commit

Permalink
fix the model restore path error
Browse files Browse the repository at this point in the history
  • Loading branch information
iamaaditya committed Nov 16, 2016
1 parent ec6d19e commit ea92518
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions params.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def __init__(self, verbose):
self.data_train_path = './data/train.pickle'
self.data_test_path = './data/test.pickle'
self.resume_training = True
self.on_resume_fix_lr = True

if verbose:
pprint(self.__dict__)
6 changes: 5 additions & 1 deletion train.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import division
from __future__ import print_function
import math
import os
import tensorflow as tf
Expand Down Expand Up @@ -55,7 +56,10 @@ def sparse_labels_or_not(batch):
sess.run(tf.initialize_all_variables())

if tparam.resume_training:
saver.restore(sess, tparam.model_path + '/model')
saver.restore(sess, tparam.model_path + 'model')
if tparam.on_resume_fix_lr:
optimizer = tf.train.AdamOptimizer(tparam.learning_rate)
print("model restored...")

# for the pretty pretty tensorboard
summary_writer = tf.train.SummaryWriter('tensorboards', sess.graph)
Expand Down

0 comments on commit ea92518

Please sign in to comment.