I am following this tutorial on recurrent neural networks.
This is import:
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from tensorflow.python.ops import rnn
from tensorflow.contrib.rnn import core_rnn_cell
This is the code for handling input:
x = tf.transpose(x, [1,0,2])
x = tf.reshape(x, [-1, chunk_size])
x = tf.split(x, n_chunks, 0)
lstm_cell = core_rnn_cell.BasicLSTMCell(rnn_size)
outputs, states = rnn.rnn(lstm_cell, x, dtype=tf.float32)
I get the following error for outputs, states:
AttributeError: module 'tensorflow.python.ops.rnn' has no attribute 'rnn'
TensorFlow has recently been updated, so what should be the new code for the offensive line
source
share