Open srinivasan3 opened 7 years ago
I have the same problem
You can change these two lines lstm_cell = tf.contrib.rnn.LSTMCell(hidden_size) multi_lstm_cells = tf.contrib.rnn.MultiRNNCell(cells=[lstm_cell] * 2, state_is_tuple=True)
To the following, it will work.
def lstm_cell(): return tf.contrib.rnn.LSTMCell(hidden_size) multi_lstm_cells = tf.contrib.rnn.MultiRNNCell([lstmcell() for in xrange(2)], state_is_tuple=True)
For Python 3 Replace xrange
to range
in the last line
def lstm_cell():
return tf.contrib.rnn.LSTMCell(hidden_size)
multi_lstm_cells = tf.contrib.rnn.MultiRNNCell([lstm_cell() for _ in range(2)], state_is_tuple=True)
Running the solutions cell: ValueError: Trying to share variable rnn/multi_rnn_cell/cell_0/lstm_cell/kernel, but specified shape (200, 400) and found shape (7697, 400).