Closed hemavakade closed 7 years ago
Solved it by adding the following if condition in train_model
function inside train.py
if restore_iter > 0: # Change added
if restore:
try:
ckpt = tf.train.get_checkpoint_state(self.output_dir)
print 'Restoring from {}...'.format(ckpt.model_checkpoint_path),
self.saver.restore(sess, ckpt.model_checkpoint_path)
stem = os.path.splitext(os.path.basename(ckpt.model_checkpoint_path))[0]
restore_iter = int(stem.split('_')[-1])
sess.run(global_step.assign(restore_iter))
print 'done'
except:
raise 'Check your pretrained {:s}'.format(ckpt.model_checkpoint_path)
Great to hear that.
But it's not actually been solved.
TF1.0 change restore api. There's no model_checkpoint_path
.
You can restore pretrained model with:
restorer = tf.train.Saver() # restoring all the vars
restorer.restore(sess, tf.train.latest_checkpoint(checkpoint_dir))
Env details: GPU : TITAN X cuda 8.0+cudnn 5.1 tensorflow version : 0.11.0
I followed the Readme and ran the following command
I get the following error:
IMO, there is no checkpoint before the model runs the first iteration. How do I get around this error?