Closed zuxfoucault closed 7 years ago
You need to instantiate the cell multiple times. Something like this:
# Create the internal multi-layer cell for our
cell_type = tf.nn.rnn_cell.GRUCell
if use_lstm:
cell_type = tf.nn.rnn_cell.BasicLSTMCell
cell = cell_type(size)
if num_layers > 1:
cell = tf.nn.rnn_cell.MultiRNNCell([cell_type(size) for _ in range(num_layers)])`
Thanks @raphael-sch and @zuxfoucault, the code is now updated to work with the latest TensorFlow API r1.2. Sorry for the delayed updates.
Due to this change in Tensorflow as the suggestion:
Should
cell = tf.contrib.rnn.MultiRNNCell([single_cell] * num_layers])
in line be updated tocell = tf.contrib.rnn.MultiRNNCell([single_cell for _ in range(num_layers)])
? Thanks!