2017-07-10 1 views

Antwort

0

für

from tensorflow.contrib.rnn.python.ops import core_rnn 
from tensorflow.contrib.rnn.python.ops import core_rnn_cell 
from tensorflow.contrib.rnn.python.ops import core_rnn_cell_impl 

in tf1.2, es sollte ein Ersatz sein wie:

#cell = core_rnn_cell.OutputProjectionWrapper(cell, output_symbols) 
cell = tf.nn.OutputProjectionWrapper(cell, output_symbols) 

#_, enc_state = core_rnn.static_rnn(cell, encoder_inputs, dtype=dtype, scope=scope) 
_, enc_state = tf.nn.static_rnn(cell, encoder_inputs, dtype=dtype, scope=scope) 

#y = linear(query, attention_vec_size, True) 
y = rnn_cell_impl._linear(query, attention_vec_size, True) 
0

Vom Tensorflow 1.2 changelog:

Many of the RNN functions and classes that were in the tf.nn namespace before the 1.0 release and which were moved to tf.contrib.rnn have now been moved back to the core namespace. This includes RNNCell, LSTMCell, GRUCell, and a number of other cells. These now reside in tf.nn.rnn_cell (with aliases in tf.contrib.rnn for backwards compatibility). The original tf.nn.rnn function is now tf.nn.static_rnn, and the bidirectional static and state saving static rnn functions are also now back in the tf.nn namespace.

Es sieht aus wie Sie Ihren Code aktualisieren müssen werde tf.nn.rnn zu verwenden, tf.nn.rn_cell und ich bin ziemlich sicher, dass Sie shoul Es sollte sich nicht um eine '* _impl' Datei handeln, die von der API versteckt werden soll und sich jederzeit ändern kann.

+0

nicht helfen kann, wenn ich nicht sehen te alten Code haben ... – GPhilo

+0

Bitte bearbeiten Sie die Frage, Kommentare sind der schlechteste Ort, um Code-Snippets zu setzen, da die Formatierung immer verloren geht. – GPhilo

+1

Ich habe es schließlich durch "finden" + "grep" den Tensorflow-Quellcode behoben, um den korrekten Namenspfad zu finden. Danke, Gphilo –

Verwandte Themen