按照序列到序列教程中的说明我收到以下错误消息:https: //www.tensorflow.org/tutorials/seq2seq
我跑的时候
python translate.py --data-dir [your data directory]
Run Code Online (Sandbox Code Playgroud)
当脚本创建图层时,我最终得到以下错误:
AttributeError: 'NoneType' object has no attribute 'update'
Run Code Online (Sandbox Code Playgroud)
(下面的完整堆栈跟踪)
系统信息:
此外,WMT数据已被下载和处理.我按照教程中的说明下载了英语到法语的数据.
任何帮助将不胜感激.
Preparing WMT data in /tmp
2017-06-16 09:28:44.185353: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-06-16 09:28:44.185383: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-06-16 09:28:44.185388: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-06-16 09:28:44.185393: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
Creating 3 layers of 1024 units.
Traceback (most recent call last):
File "translate.py", line 322, in <module>
tf.app.run()
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/site-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 "/Users/<redacted>/models/tutorials/rnn/translate/seq2seq_model.py", line 179, in __init__
softmax_loss_function=softmax_loss_function)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/site-packages/tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py", line 1206, in model_with_buckets
decoder_inputs[:bucket[1]])
File "/Users/<redacted>/models/tutorials/rnn/translate/seq2seq_model.py", line 178, in <lambda>
lambda x, y: seq2seq_f(x, y, False),
File "/Users/<redacted>/models/tutorials/rnn/translate/seq2seq_model.py", line 142, in seq2seq_f
dtype=dtype)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/site-packages/tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py", line 848, in embedding_attention_seq2seq
encoder_cell = copy.deepcopy(cell)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 166, in deepcopy
y = copier(memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/site-packages/tensorflow/python/layers/base.py", line 476, in __deepcopy__
setattr(result, k, copy.deepcopy(v, memo))
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 155, in deepcopy
y = copier(x, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 218, in _deepcopy_list
y.append(deepcopy(a, memo))
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 182, in deepcopy
y = _reconstruct(x, rv, 1, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 297, in _reconstruct
state = deepcopy(state, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 155, in deepcopy
y = copier(x, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 243, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 182, in deepcopy
y = _reconstruct(x, rv, 1, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 297, in _reconstruct
state = deepcopy(state, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 155, in deepcopy
y = copier(x, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 243, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 155, in deepcopy
y = copier(x, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 218, in _deepcopy_list
y.append(deepcopy(a, memo))
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 182, in deepcopy
y = _reconstruct(x, rv, 1, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 297, in _reconstruct
state = deepcopy(state, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 155, in deepcopy
y = copier(x, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 243, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 155, in deepcopy
y = copier(x, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 218, in _deepcopy_list
y.append(deepcopy(a, memo))
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 155, in deepcopy
y = copier(x, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 223, in _deepcopy_tuple
y = [deepcopy(a, memo) for a in x]
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 223, in <listcomp>
y = [deepcopy(a, memo) for a in x]
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 155, in deepcopy
y = copier(x, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 243, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 182, in deepcopy
y = _reconstruct(x, rv, 1, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 297, in _reconstruct
state = deepcopy(state, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 155, in deepcopy
y = copier(x, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 243, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 182, in deepcopy
y = _reconstruct(x, rv, 1, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 297, in _reconstruct
state = deepcopy(state, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 155, in deepcopy
y = copier(x, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 243, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 182, in deepcopy
y = _reconstruct(x, rv, 1, memo)
File "/Users/<redacted>/anaconda/envs/tf/lib/python3.5/copy.py", line 306, in _reconstruct
y.__dict__.update(state)
AttributeError: 'NoneType' object has no attribute 'update'
Run Code Online (Sandbox Code Playgroud)
小智 5
对于RNNCell的深度复制似乎存在问题,我们在这个github错误中跟踪它:https://github.com/tensorflow/tensorflow/issues/8191
另外,还有一个新的TensorFlow seq2seq仓库,其中包含许多型号:https://github.com/google/seq2seq,如果您只对结果而不是模型感兴趣,那么我们在这里有新型号:https://github.com/tensorflow/tensor2tensor对于任何情况下的错误,请查看github错误页面,了解有关该解决方案的更多详细信息.
| 归档时间: |
|
| 查看次数: |
649 次 |
| 最近记录: |