tensorflowr1.2 translate.py AttributeError:' NoneType'对象没有属性'更新'

时间:2017-06-09 09:24:16

标签: python-2.7 ubuntu tensorflow

我现在使用twensorflow来实现nmt。当我运行张量流情况时,会出现以下问题。我使用tensorflow1.2。

问题显示在fllow中。

创建3层1024个单位。

Traceback (most recent call last):
File "translate.py", line 322, 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 "translate.py", line 319, in main
    train()
    File "translate.py", line 178, in train
    model = create_model(sess, False)
    File "translate.py", line 136, in create_model dtype=dtype)
    File "/home/kings/models/tutorials/rnn/translate/seq2seq_model.py", line 179, in __init__ softmax_loss_function=softmax_loss_function)
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py", line 1206, in model_with_buckets
    decoder_inputs[:bucket[1]])
    File "/home/kings/models/tutorials/rnn/translate/seq2seq_model.py", line 178, in <lambda>lambda x, y: seq2seq_f(x, y, False),
    File "/home/kings/models/tutorials/rnn/translate/seq2seq_model.py", line 142, in seq2seq_f
    dtype=dtype)
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py", line 848, in embedding_attention_seq2seq encoder_cell = copy.deepcopy(cell)
    File "/usr/lib/python2.7/copy.py", line 174, in deepcopy y = copier(memo)
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/layers/base.py", line 476, in __deepcopy__ setattr(result, k, copy.deepcopy(v, memo))
    File "/usr/lib/python2.7/copy.py", line 163, in deepcopy y = copier(x, memo)
    File "/usr/lib/python2.7/copy.py", line 230, in _deepcopy_list
    y.append(deepcopy(a, memo))
    File "/usr/lib/python2.7/copy.py", line 190, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
    File "/usr/lib/python2.7/copy.py", line 334, in _reconstruct
    state = deepcopy(state, memo)
    File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
    File "/usr/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
    File "/usr/lib/python2.7/copy.py", line 190, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
    File "/usr/lib/python2.7/copy.py", line 334, in _reconstruct
    state = deepcopy(state, memo)
    File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
    File "/usr/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
    File "/usr/lib/python2.7/copy.py", line 190, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
    File "/usr/lib/python2.7/copy.py", line 334, in _reconstruct
    state = deepcopy(state, memo)
    File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
    File "/usr/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
    File "/usr/lib/python2.7/copy.py", line 190, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
    File "/usr/lib/python2.7/copy.py", line 334, in _reconstruct
    state = deepcopy(state, memo)
    File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
    File "/usr/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
    File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
    File "/usr/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
    File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
    File "/usr/lib/python2.7/copy.py", line 230, in _deepcopy_list
    y.append(deepcopy(a, memo))
    File "/usr/lib/python2.7/copy.py", line 190, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
    File "/usr/lib/python2.7/copy.py", line 334, in _reconstruct
    state = deepcopy(state, memo)
    File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
    File "/usr/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
    File "/usr/lib/python2.7/copy.py", line 190, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
    File "/usr/lib/python2.7/copy.py", line 334, in _reconstruct
    state = deepcopy(state, memo)
    File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
    File "/usr/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
    File "/usr/lib/python2.7/copy.py", line 190, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
    File "/usr/lib/python2.7/copy.py", line 334, in _reconstruct
    state = deepcopy(state, memo)
    File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
    File "/usr/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
    File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
    File "/usr/lib/python2.7/copy.py", line 230, in _deepcopy_list
    y.append(deepcopy(a, memo))
    File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
    File "/usr/lib/python2.7/copy.py", line 237, in _deepcopy_tuple
    y.append(deepcopy(a, memo))
    File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
    File "/usr/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
    File "/usr/lib/python2.7/copy.py", line 190, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
    File "/usr/lib/python2.7/copy.py", line 334, in _reconstruct
    state = deepcopy(state, memo)
    File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
    File "/usr/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
    File "/usr/lib/python2.7/copy.py", line 190, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
    File "/usr/lib/python2.7/copy.py", line 343, in _reconstruct
    y.__dict__.update(state)
AttributeError: 'NoneType' object has no attribute 'update'

源代码,例如网站链接:https://github.com/tensorflow/models/tree/master/tutorials/rnn/translate

我刚开始学习,迫切需要你的帮助。提前谢谢。

0 个答案:

没有答案