tensorflow: Tutorial has error: Recurrent Neural Networks
Tutorial URL: https://www.tensorflow.org/tutorials/recurrent I’m going through the tutorial listed above and I think there is a mistake in the very first code example:
lstm = tf.contrib.rnn.BasicLSTMCell(lstm_size)
# Initial state of the LSTM memory.
state = tf.zeros([batch_size, lstm.state_size])
An error is reported for the third line:
ValueError: setting an array element with a sequence.
If one prints the lstm.state_size
object (where say, lstm_size = 50) one finds:
LSTMStateTuple(c=50, h=50)
I’m guessing this should be:
lstm = tf.contrib.rnn.BasicLSTMCell(lstm_size)
# Initial state of the LSTM memory.
state = tf.zeros([batch_size, lstm_size])
But frankly there are numerous other errors in this tutorial as well, so I’m not sure. I will continue to report them as I find them. Version: tensorflow_gpu-1.0.1-cp27-none-linux_x86_64.whl Running on Ubuntu 14.04
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 38 (13 by maintainers)
While this tutorial is just a little outdated (they still point to RNNCells in tf.nn.rnn_cell instead of tf.contrib.rnn), a lot of the examples are still very good:
http://www.wildml.com/2016/08/rnns-in-tensorflow-a-practical-guide-and-undocumented-features/
On Tue, Apr 18, 2017 at 2:42 PM, Kevin Shaw notifications@github.com wrote:
You don’t. We should really change the tutorial to use tf.nn.dynamic_rnn – which handles most of this for you.
On Tue, Apr 18, 2017 at 2:28 PM, Kevin Shaw notifications@github.com wrote:
@kevinashaw Did you finally find a solution for the linear problem?
@kevinashaw that’s where I am now too. It seems like we are not presenting arguments to the
__call__
method oflstm
correctly. I am working a different problem, but same issue.