代码很简单,只需要执行下面,自会自动将参数以及计算图恢复,准备计算。
ckpt = tf.train.get_checkpoint_state(FLAGS.logs_dir)
if ckpt and ckpt.model_checkpoint_path:
saver.restore(sess, ckpt.model_checkpoint_path)#自动恢复model_checkpoint_path保存模型一般是最新
print("Model restored...")
代码很简单,只需要执行下面,自会自动将参数以及计算图恢复,准备计算。
ckpt = tf.train.get_checkpoint_state(FLAGS.logs_dir)
if ckpt and ckpt.model_checkpoint_path:
saver.restore(sess, ckpt.model_checkpoint_path)#自动恢复model_checkpoint_path保存模型一般是最新
print("Model restored...")