RNN调试错误:lstm_cell = tf.contrib.rnn.core_rnn_cell.BasicLSTMCell(lstm_size) 方法已失效

调试递归神经网络(RNN)的时候出现如下错误:

### module 'tensorflow.contrib.rnn' has no attribute 'core_rnn_cell'

RNN调试错误:lstm_cell = tf.contrib.rnn.core_rnn_cell.BasicLSTMCell(lstm_size) 方法已失效

经检查是tf.contrib.rnn.core_rnn_cell.BasicLSTMCell(lstm_size) 此方法已被禁用,采用了新的方法:rnn.BasicLSTMCell(lstm_size)   

使用此方法时需引入RNN如下:

 from tensorflow.contrib import rnn

友情提示:用Jupyter时,import部分和其他代码不要放在一个代码块

具体源码在:https://download.****.net/download/doubleicefire/10312061