我正在與使用Tensorflow的指針生成網絡相關的斯坦福存儲庫。這個倉庫可以在這裏找到:
https://github.com/abisee/pointer-generatorTensorflow Checkpoint在另一個系統上使用時不會產生問題。 Python2/3
我已經在這個倉庫的問題,部分要求演示關卡和人名的喜悅一個人回答我,他的實驗的檢查點。你可以在這裏看到:
https://github.com/abisee/pointer-generator/issues/12#issuecomment-320558080
現在,當我與運行的代碼檢查點,我收到以下異常或錯誤:
INFO:tensorflow:Loading checkpoint log/directory/myexperiment/train/model.ckpt-44550
INFO:tensorflow:Restoring parameters from log/directory/myexperiment/train/model.ckpt-44550
2017-08-08 11:40:45.466505: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key seq2seq/decoder/attention_decoder/lstm_cell/bias not found in checkpoint
2017-08-08 11:40:45.468174: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key seq2seq/decoder/attention_decoder/lstm_cell/kernel not found in checkpoint
2017-08-08 11:40:45.475224: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key seq2seq/encoder/bidirectional_rnn/bw/lstm_cell/kernel not found in checkpoint
2017-08-08 11:40:45.475255: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key seq2seq/encoder/bidirectional_rnn/bw/lstm_cell/bias not found in checkpoint
2017-08-08 11:40:45.488580: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key seq2seq/encoder/bidirectional_rnn/fw/lstm_cell/bias not found in checkpoint
2017-08-08 11:40:45.489057: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key seq2seq/encoder/bidirectional_rnn/fw/lstm_cell/kernel not found in checkpoint
INFO:tensorflow:Failed to load checkpoint from log/directory/myexperiment/train. Sleeping for 10 secs...
INFO:tensorflow:Loading checkpoint log/directory/myexperiment/train/model.ckpt-44550
INFO:tensorflow:Restoring parameters from log/directory/myexperiment/train/model.ckpt-44550
2017-08-08 11:40:55.630779: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key seq2seq/decoder/attention_decoder/lstm_cell/kernel not found in checkpoint
2017-08-08 11:40:55.631279: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key seq2seq/decoder/attention_decoder/lstm_cell/bias not found in checkpoint
2017-08-08 11:40:55.645013: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key seq2seq/encoder/bidirectional_rnn/bw/lstm_cell/bias not found in checkpoint
2017-08-08 11:40:55.651307: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key seq2seq/encoder/bidirectional_rnn/fw/lstm_cell/bias not found in checkpoint
2017-08-08 11:40:55.654461: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key seq2seq/encoder/bidirectional_rnn/bw/lstm_cell/kernel not found in checkpoint
2017-08-08 11:40:55.661814: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key seq2seq/encoder/bidirectional_rnn/fw/lstm_cell/kernel not found in checkpoint
所以我想檢查是否問題的原因是GPU或CPU一個所以就用從問題的答案的溶液:)
2)Can a model trained on gpu used on cpu for inference and vice versa?
我TR以使文件run_summarization.py
中的更改爲:
def setup_training(model, batcher):
"""Does setup before starting training (run_training)"""
train_dir = os.path.join(FLAGS.log_root, "train")
if not os.path.exists(train_dir): os.makedirs(train_dir)
default_device = tf.device('/gpu:0') #tf.device('/cpu:0')
with default_device:
model.build_graph() # build the graph
if FLAGS.convert_to_coverage_model:
assert FLAGS.coverage, "To convert your non-coverage model to a coverage model, run with convert_to_coverage_model=True and coverage=True"
convert_to_coverage_model()
saver = tf.train.Saver(max_to_keep=1) # only keep 1 checkpoint at a time
但它沒有工作。請讓我知道我需要做什麼來使張量流檢查點在任何帶有可用代碼的系統上運行。如果可能的話,不要更改代碼。
實際上,訓練過的模型是已經從一些其他人的計算機上訓練過來的,在我的情況下,這個快樂給了我。我只是想把它和我的系統連接起來。 –