2017-06-16 4 views
4

ich die folgende Fehlermeldung ich immer, wenn die Anweisungen in der Sequenz zu Sequenz Tutorial folgende: https://www.tensorflow.org/tutorials/seq2seqFehler beim Ausführen von Tensorflow Sequenz Tutorial: Sequenzieren

Als ich

python translate.py --data-dir [your data directory] 

ich schließlich erhalten die folgende laufen Fehler, wenn das Skript schafft die Schichten:

AttributeError: 'NoneType' object has no attribute 'update' 

(Voll-Stack-Trace)

Systeminfo:

  • macOS 10.12.5
  • Python 3.5.3
  • Tensorflow 1.2.0
  • Tensorflow über pip installiert (9.0.1) innerhalb Conda (4.3.21)

Auch die WMT-Daten wurden heruntergeladen und verarbeitet. Ich habe die Englisch-Französisch-Daten wie im Tutorial angegeben heruntergeladen.

Jede Hilfe würde sehr geschätzt werden.

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' 

Antwort

3

Das Modell scheint gut zu funktionieren, wenn Sie nur einen Eimer haben. Während Sie darauf warten, dass der Fehler behoben wird, wenn Sie nur ein erstes Ergebnis sehen möchten, ändern Sie in translate.py die Liste der 4 Buckets: _buckets = [(5, 10), (10, 15), (20, 25), (40, 50)] zu nur einem Eimer, z _Buckets = [(10, 15)].

+0

Das funktioniert tatsächlich. Was bedeuten die Eimer und was bedeuten ihre Abmessungen? – composer314

5

Es scheint ein Problem mit dem deep RNNCell zu sein, wir es in diesem Github Bug-Tracking: https://github.com/tensorflow/tensorflow/issues/8191

Auf einer separate Notiz, gibt es eine neue TensorFlow seq2seq Repo mit vielen Modellen hier: https://github.com/google/seq2seq und wenn Sie nur am Ergebnis und nicht am Modell interessiert sind, dann haben wir hier neue Modelle: https://github.com/tensorflow/tensor2tensor Sorry für den Fehler in jedem Fall, bitte überprüfen Sie auf der GitHub-Bug-Seite für weitere Details zur Lösung.

+0

Danke! Ich werde mir beide Repos ansehen. – composer314

Verwandte Themen