当我恢复训练有素的模型时,我在下面遇到了这些错误。会导致这种情况发生的原因以及如何找出这些错误?欣赏它!!!
2017-08-10 09:50:09.228153: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key test/Q_forward/RNN/rnn/gru_cell/candidate/bias not found in checkpoint
2017-08-10 09:50:09.228153: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key test/P_forward/RNN/rnn/gru_cell/gates/kernel not found in checkpoint
2017-08-10 09:50:09.228184: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key test/global_step not found in checkpoint
2017-08-10 09:50:09.228231: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key test/P_forward/RNN/rnn/gru_cell/candidate/kernel not found in checkpoint
2017-08-10 09:50:09.228260: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key test/P_forward/embs/embs not found in checkpoint
2017-08-10 09:50:09.228353: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key test/P_forward/RNN/rnn/gru_cell/candidate/bias not found in checkpoint
2017-08-10 09:50:09.228558: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key test/P_forward/RNN/rnn/gru_cell/gates/bias not found in checkpoint
2017-08-10 09:50:09.229262: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key test/Q_forward/RNN/rnn/gru_cell/candidate/kernel not found in checkpoint
2017-08-10 09:50:09.229581: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key test/Q_forward/RNN/rnn/gru_cell/gates/kernel not found in checkpoint
2017-08-10 09:50:09.229610: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key test/Q_forward/embs/embs not found in checkpoint
2017-08-10 09:50:09.229646: W tensorflow/core/framework/op_kernel.cc:1158] Not found: Key test/Q_forward/RNN/rnn/gru_cell/gates/bias not found in checkpoint
这是Traceback:
Traceback (most recent call last):
File "/home/ljn/PycharmProjects/RNN_QA/src/QA_lstm.py", line 529, in <module>tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "/home/ljn/PycharmProjects/RNN_QA/src/QA_lstm.py", line 515, in main
Test(train_model, te_data_batches, config, FLAGS.num_steps_pre,
FLAGS.num_steps_q, triplet, vocab)
File "/home/ljn/PycharmProjects/RNN_QA/src/QA_lstm.py", line 400, in Test
model.saver.restore(sess, ckpt_state.model_checkpoint_path) #tf.train.latest_checkpoint('../data/log_root/.')
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1548, in restore
{self.saver_def.filename_tensor_name: save_path})
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 789, in run
run_metadata_ptr)
答案 0 :(得分:0)
在导入tensorflow
时添加以下行import tensorflow as tf
tf.reset_default_graph()