我收到了错误,尝试在tensorflow(https://github.com/golbin/TensorFlow-Tutorials/tree/master/08%20-%20RNN/ChatBot)
中进行chatbot示例我不知道错误是什么。 吼叫是错误
Caused by op 'save/RestoreV2_11', defined at:
File "chat.py", line 79, in <module>
tf.app.run()
File "/home/ubuntu/tensor/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "chat.py", line 75, in main
chatbot = ChatBot(FLAGS.voc_path, FLAGS.train_dir)
File "chat.py", line 17, in __init__
self.model = Seq2Seq(self.dialog.vocab_size)
File "/home/ubuntu/example/TensorFlow-Tutorials/08 - RNN/ChatBot/model.py", line 30, in __init_ _
self.saver = tf.train.Saver(tf.global_variables())
File "/home/ubuntu/tensor/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 1140, in __init__
self.build()
File "/home/ubuntu/tensor/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 1172, in build
filename=self._filename)
File "/home/ubuntu/tensor/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 688, in build
restore_sequentially, reshape)
File "/home/ubuntu/tensor/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 407, in _AddRestoreOps
tensors = self.restore_op(filename_tensor, saveable, preferred_shard)
File "/home/ubuntu/tensor/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 247, in restore_op
[spec.tensor.dtype])[0])
File "/home/ubuntu/tensor/lib/python3.5/site-packages/tensorflow/python/ops/gen_io_ops.py", line 663, in restore_v2
dtypes=dtypes, name=name)
File "/home/ubuntu/tensor/lib/python3.5/site-packages/tensorflow/python/framework/op_def_librar y.py", line 767, in apply_op
op_def=op_def)
File "/home/ubuntu/tensor/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 2630, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/home/ubuntu/tensor/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1204, in __init__
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
NotFoundError (see above for traceback): Key
decode/rnn/multi_rnn_cell/cell_1/basic_rnn_cell/bias
not found in checkpoint
[[Node: save/RestoreV2_11 = RestoreV2[dtypes=[DT_FLOAT],
_device="/job:localhost/replica
:0/task:0/cpu:0"](_arg_save/Const_0_0, save/RestoreV2_11/tensor_names,
save/RestoreV2_11/shape_and_slices)]]
答案 0 :(得分:0)
您需要申请this solution
使用适当的vars_to_rename
可能使用这个
"lstm/BasicLSTMCell/Linear/Bias": "lstm/basic_lstm_cell/biases"