Python 运行Tensorflow序列到序列教程时出错
按照顺序到顺序教程中的说明操作时,我收到以下错误消息: 当我跑的时候Python 运行Tensorflow序列到序列教程时出错,python,tensorflow,Python,Tensorflow,按照顺序到顺序教程中的说明操作时,我收到以下错误消息: 当我跑的时候 python translate.py --data-dir [your data directory] 当脚本创建层时,我最终得到以下错误: AttributeError: 'NoneType' object has no attribute 'update' (下面是完整的堆栈跟踪) 系统信息: macOS 10.12.5 Python 3.5.3 Tensorflow 1.2.0 Tensorflow通过管道(9
python translate.py --data-dir [your data directory]
当脚本创建层时,我最终得到以下错误:
AttributeError: 'NoneType' object has no attribute 'update'
(下面是完整的堆栈跟踪)
系统信息:
- macOS 10.12.5
- Python 3.5.3
- Tensorflow 1.2.0
- Tensorflow通过管道(9.0.1)安装在康达(4.3.21)内
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'
在/tmp中准备WMT数据
2017-06-16 09:28:44.185353:W tensorflow/core/platform/cpu_feature_guard.cc:45]tensorflow库的编译不是为了使用SSE4.2指令,但这些指令在您的机器上可用,可以加快cpu计算。
2017-06-16 09:28:44.185383:W tensorflow/core/platform/cpu_feature_guard.cc:45]tensorflow库的编译不是为了使用AVX指令,但这些指令在您的机器上可用,可以加快cpu计算。
2017-06-16 09:28:44.185388:W tensorflow/core/platform/cpu_feature_guard.cc:45]tensorflow库的编译不是为了使用AVX2指令,但这些指令在您的机器上可用,可以加快cpu计算。
2017-06-16 09:28:44.185393:W tensorflow/core/platform/cpu_feature_guard.cc:45]tensorflow库的编译不是为了使用FMA指令,但这些指令在您的机器上可用,可以加快cpu计算。
创建3层1024个单元。
回溯(最近一次呼叫最后一次):
文件“translate.py”,第322行,在
tf.app.run()
文件“/Users//anaconda/envs/tf/lib/python3.5/site packages/tensorflow/python/platform/app.py”,第48行,运行中
_系统出口(主(_sys.argv[:1]+标志_passthrough))
文件“translate.py”,第319行,在main中
列车()
列中第178行的文件“translate.py”
模型=创建模型(sess,False)
文件“translate.py”,第136行,在create_模型中
dtype=dtype)
文件“/Users//models/tutorials/rnn/translate/seq2seq_model.py”,第179行,在__
softmax_损耗函数=softmax_损耗函数)
文件“/Users//anaconda/envs/tf/lib/python3.5/site-packages/tensorflow/contrib/legacy_-seq2seq/python/ops/seq2seq.py”,第1206行,模型中带桶
解码器_输入[:bucket[1]])
文件“/Users//models/tutorials/rnn/translate/seq2seq_model.py”,第178行,中
λx,y:seq2seq_f(x,y,False),
文件“/Users//models/tutorials/rnn/translate/seq2seq_model.py”,第142行,在seq2seq_f中
dtype=dtype)
文件“/Users//anaconda/envs/tf/lib/python3.5/site packages/tensorflow/contrib/legacy_-seq2seq/python/ops/seq2seq.py”,第848行,嵌入_-attention_-seq2seq
编码器\单元=复制。深度复制(单元)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第166行,在deepcopy中
y=复印机(备忘录)
文件“/Users//anaconda/envs/tf/lib/python3.5/site packages/tensorflow/python/layers/base.py”,第476行,在__
setattr(结果,k,副本。深度副本(v,备忘录))
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第155行,在deepcopy中
y=复印机(x,备忘)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第218行,在深度复制列表中
y、 附加(副本(a、备忘录))
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第182行,在deepcopy中
y=_(x,rv,1,备忘录)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第297行,在
状态=深度复制(状态,备忘录)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第155行,在deepcopy中
y=复印机(x,备忘)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第243行,在dict中
y[deepcopy(key,memo)]=deepcopy(value,memo)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第182行,在deepcopy中
y=_(x,rv,1,备忘录)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第297行,在
状态=深度复制(状态,备忘录)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第155行,在deepcopy中
y=复印机(x,备忘)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第243行,在dict中
y[deepcopy(key,memo)]=deepcopy(value,memo)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第155行,在deepcopy中
y=复印机(x,备忘)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第218行,在深度复制列表中
y、 附加(副本(a、备忘录))
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第182行,在deepcopy中
y=_(x,rv,1,备忘录)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第297行,在
状态=深度复制(状态,备忘录)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第155行,在deepcopy中
y=复印机(x,备忘)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第243行,在dict中
y[deepcopy(key,memo)]=deepcopy(value,memo)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第155行,在deepcopy中
y=复印机(x,备忘)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第218行,在深度复制列表中
y、 附加(副本(a、备忘录))
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第155行,在deepcopy中
y=复印机(x,备忘)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第223行,在“deepcopy”元组中
y=[x中a的深度复制(a,备忘录)]
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第223行,在
y=[x中a的深度复制(a,备忘录)]
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第155行,在deepcopy中
y=复印机(x,备忘)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第243行,在dict中
y[deepcopy(key,memo)]=deepcopy(value,memo)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第182行,在deepcopy中
y=_(x,rv,1,备忘录)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第297行,在
状态=深度复制(状态,备忘录)
文件“/Users//anaconda/envs/tf/lib/python3.5/copy.py”,第155行,在deepcopy中
y=复印机(x,备忘)
文件“/Users//anaconda/envs/tf/