0
將Tensorflow升級到r1.0後,恢復命令似乎不起作用。 例如,任何人都可以告訴我以下哪些問題?如何在Tensorflow中恢復變量r1.0
def foo():
v1 = tf.Variable(1., name="v1")
v2 = tf.Variable(2., name="v2")
v3 = v1 + v2
saver = tf.train.Saver()
with tf.Session() as sess:
tf.global_variables_initializer().run()
saver.save(sess, "temp")
# do something
saver.restore(sess, "temp")
從上線,我得到了一個錯誤:
tensorflow.python.framework.errors_impl.NotFoundError: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for temp
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]
Tensorflow文檔仍持有舊版本對此事的解釋。
它的工作原理!非常感謝! – user3755060