在tensorflow的translate的实例中遇到错误:
Traceback (most recent call last):
File "/Users/mac/PycharmProjects/Mytensorflow/RNN/translate/translate.py", line 319, in
self()
File "/Users/mac/PycharmProjects/Mytensorflow/RNN/translate/translate.py", line 294, in self
5.0, 32, 0.3, 0.99, num_samples=8)
File "/Users/mac/PycharmProjects/Mytensorflow/RNN/translate/seq2seq_model.py", line 177, in __init__
softmax_loss_function=softmax_loss_function)
File "/anaconda/lib/python2.7/site-packages/tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py", line 1201, in model_with_buckets
decoder_inputs[:bucket[1]])
File "/Users/mac/PycharmProjects/Mytensorflow/RNN/translate/seq2seq_model.py", line 176, in
lambda x, y: seq2seq_f(x, y, False),
File "/Users/mac/PycharmProjects/Mytensorflow/RNN/translate/seq2seq_model.py", line 140, in seq2seq_f
dtype=dtype)
File "/anaconda/lib/python2.7/site-packages/tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py", line 855, in embedding_attention_seq2seq
encoder_cell, encoder_inputs, dtype=dtype)
File "/anaconda/lib/python2.7/site-packages/tensorflow/contrib/rnn/python/ops/core_rnn.py", line 197, in static_rnn
(output, state) = call_cell()
File "/anaconda/lib/python2.7/site-packages/tensorflow/contrib/rnn/python/ops/core_rnn.py", line 184, in
call_cell = lambda: cell(input_, state)
File "/anaconda/lib/python2.7/site-packages/tensorflow/contrib/rnn/python/ops/core_rnn_cell_impl.py", line 881, in __call__
return self._cell(embedded, state)
File "/anaconda/lib/python2.7/site-packages/tensorflow/contrib/rnn/python/ops/core_rnn_cell_impl.py", line 146, in __call__
with _checked_scope(self, scope or "gru_cell", reuse=self._reuse):
File "/anaconda/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/anaconda/lib/python2.7/site-packages/tensorflow/contrib/rnn/python/ops/core_rnn_cell_impl.py", line 77, in _checked_scope
type(cell).__name__))
ValueError: Attempt to reuse RNNCell
解决这个问题的方法是:将tendorflow升级到最新的tendorflow的1.4版本,但是还会出现
A[seq2seq_model.py AttributeError: 'NoneType' object has no attribute 'update'](http://blog.csdn.net/meijie770342/article/details/78984309),请参考