今天在网上学习RNN递归神经网络时,运行视频中代码
lstm_cell = tf.contrib.cnn.core_rnn_cell.BasicLSTMCell
时,遇到报错:
AttributeError:module ‘tensorflow.contrib.rnn’ has no attribute 'core_rnn_cell
在CSDN上找到一篇博客,解决了上述代码问题,即将代码修改为:
lstm_cell = tf.nn.rnn_cell.BasicLSTMCell(lstm_size)
即可解决报错问题。
转载的原文链接 AttributeError: module ‘tensorflow.contrib.rnn’ has no attribute 'core_rnn_cell’报错解决方法