TensorFlow原版本报错:AttributeError: module 'tensorflow.python.ops.rnn' has no attribute 'rnn'
from tensorflow.python.ops import rnn, rnn_cell
lstm_cell = rnn_cell.BasicLSTMCell(rnn_size,state_is_tuple=True)
outputs, states = rnn.rnn(lstm_cell, x, dtype=tf.float32)
应该替换为:
from tensorflow.contrib import rnn
lstm_cell = rnn.BasicLSTMCell(rnn_size)
outputs, states = rnn.static_rnn(lstm_cell, x, dtype=tf.float32)
来源:CSDN
作者:黄鑫huangxin
链接:https://blog.csdn.net/qq_33373858/article/details/83097027