Skip to content

Commit

Permalink
A bug in model saving is fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
MG2033 committed Mar 20, 2018
1 parent 62558e2 commit b9db158
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions base_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ def __init__(self, sess, model, args):
self.summary_placeholders = {}
self.summary_ops = {}

# init the global step, global time step, the current epoch and the summaries
self.__init_global_step()
self.__init_global_time_step()
self.__init_cur_epoch()
self.__init_global_saver()

def save(self):
print("Saving model...")
self.saver.save(self.sess, self.args.checkpoint_dir, self.global_step_tensor)
Expand All @@ -35,6 +29,11 @@ def __init_global_saver(self):
self.summary_writer = tf.summary.FileWriter(self.args.summary_dir, self.sess.graph)

def _init_model(self):
# init the global step, global time step, the current epoch and the summaries
self.__init_global_step()
self.__init_global_time_step()
self.__init_cur_epoch()
self.__init_global_saver()
self.init = tf.group(tf.global_variables_initializer(), tf.local_variables_initializer())
self.sess.run(self.init)

Expand Down

0 comments on commit b9db158

Please sign in to comment.