我使用此代码来保存张量流模型:
saver = tf.train.Saver()
saver.save(session, 'model.ckpt')
现在,当我想使用此代码恢复模型时:
with tf.Session() as session:
ckpt = tf.train.get_checkpoint_state(checkpoint_dir='/Documents/')
if ckpt and ckpt.model_checkpoint_path:
saver.restore(session, ckpt.model_checkpoint_path)
else:
print("no checkpoint found")
我收到此错误:
ValueError: Fetch argument u'save/restore_all' of u'save/restore_all' cannot be interpreted as a Tensor. ("The name 'save/restore_all' refers to an Operation not in the graph.")
如何解决此问题并恢复会话?