Python Tensorflow:未找到:检查点中未找到密钥测试/全局_步骤

Python Tensorflow:未找到:检查点中未找到密钥测试/全局_步骤,python,tensorflow,neural-network,Python,Tensorflow,Neural Network,当我恢复我训练过的模型时,我在下面得到了这些错误。发生这种情况的原因是什么?如何找出这些错误?谢谢你 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 ten

当我恢复我训练过的模型时,我在下面得到了这些错误。发生这种情况的原因是什么?如何找出这些错误?谢谢你

    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 (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)
回溯(最近一次呼叫最后一次):
文件“/home/ljn/PycharmProjects/RNN_QA/src/QA_lstm.py”,第529行,在tf.app.run()中
文件“/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py”,第48行,正在运行
_系统出口(主(_sys.argv[:1]+标志_passthrough))
文件“/home/ljn/PycharmProjects/RNN_QA/src/QA_lstm.py”,第515行,主视图
测试(列车模型、te数据、批次、配置、FLAGS.num步骤、预,
FLAGS.num_steps_q,三元组,vocab)
文件“/home/ljn/PycharmProjects/RNN_QA/src/QA_lstm.py”,第400行,测试中
model.saver.restore(sess,ckpt_state.model_checkpoint_path)#tf.train.latest_checkpoint(“../data/log_root/”)
文件“/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py”,第1548行,在restore中
{self.saver\u def.filename\u tensor\u name:save\u path})
文件“/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py”,第789行,正在运行
运行_元数据_ptr)

导入Tensorflow时添加以下行:

import tensorflow as tf  
tf.reset_default_graph()  

这对我不起作用,你能解释一下这是怎么回事吗?