我在ubuntu16上使用tensorflow1.0
下面是我使用的一个在线示例:
saver = tf.train.Saver(name='saver', write_version=tf.train.SaverDef.V2)
sv = tf.train.Supervisor(logdir=FLAGS.save_path, save_model_secs=0, save_summaries_secs=0, saver=saver)
它运行和训练都很好,但是我不能从另一台计算机上运行sample模式,因为保存路径作为另一台计算机的旧目录存在。你知道吗
我得到的错误是这样的:
InvalidArgumentError (see above for traceback): Unsuccessful TensorSliceReader constructor: Failed to get matching files on /home/oldpc/model/-54: Not found: /home/oldpc/model
[[Node: saver/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_saver/Const_0, saver/RestoreV2/tensor_names, saver/RestoreV2/shape_and_slices)]]
[[Node: saver/restore_all/NoOp_1/_20 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/gpu:0", send_device="/job:localhost/replica:0/task:0/cpu:0", send_device_incarnation=1, tensor_name="edge_56_saver/restore_all/NoOp_1", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:0"]()]]
当我通过cmd line传递它时,它应该加载的路径应该是--save\u path=“home/newpc/model/”
代码来自here
您需要使用相对保存路径,而不是绝对保存路径。据我所知,一旦使用绝对存储路径,就无法更改它。我也遇到了同样的问题,在使用相对路径之前无法更改路径。你知道吗
相关问题 更多 >
编程相关推荐