2017-07-14 73 views
1

我使用tensorflow 1.0 ubuntu上16如何打開一個Tensorflow保護另一臺計算機上

我使用的是保護作爲folows,從一個例子在線:

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) 

它運行和訓練良好,但是我不能從另一臺計算機運行示例模式,因爲保存路徑作爲另一臺計算機的舊目錄保持不變。

錯誤我得到的是這樣的:

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線傳遞的路徑,應該是--save_path =「家用/ newpc /模型/」

的代碼是從here

回答

1

您需要使用相對保存路徑,而不是絕對的。據我所知,沒有辦法改變一次使用的絕對商店路徑。我也遇到了同樣的問題,直到我使用相對路徑時才能更改路徑。

+0

@smith是否解決了您的問題? – finbarr

+0

是的,我不得不在檢查點文件中更改它。 – smith

相關問題