![](/img/trans.png)
[英]Tensorflow error: Attempting to use uninitialized value multi_rnn_cell
[英]tensorflow NotFoundError (see above for traceback): Key decode/rnn/multi_rnn_cell/cell_1/basic_rnn_cell/
我收到錯誤,嘗試在tensorflow中使用聊天機器人示例( https://github.com/golbin/TensorFlow-Tutorials/tree/master/08%20-%20RNN/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)]]
您需要通過使用適當的vars_to_rename
來應用此解決方案 ,可能使用此方法
"lstm/BasicLSTMCell/Linear/Bias": "lstm/basic_lstm_cell/biases"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.