0

Ich verwende Tensorflow 1.0.0 und Python 3.5. Wenn ich versuche zu tun:Tensorflow-Fehler beim Import tf.nn.rnn_cell

cell = tf.nn.rnn_cell.BasicRNNCell(state_size) 

ich die folgende Fehlermeldung erhalten:

Attribute

<ipython-input-25-41a20d8458a7> in <module>() 

     1 # Forward pass 
     2 print(tf.__version__) 
    --->3 cell = tf.nn.rnn_cell.BasicRNNCell(state_size) 
     4 states_series, current_state = tf.nn.dynamic_rnn(cell, inputs_series, initial_state = init_state) 
    AttributeError: module 'tensorflow.python.ops.nn' has no attribute 'rnn_cell' 

Kann mir jemand helfen?

Antwort

2

TensorFlow ändert viele APIs vor 1.0.

Sie müssen tf.nn.rnn_cell.BasicLSTMCell durch tf.contrib.rnn.BasicLSTMCell

ersetzen