Value Error problem with multicell Dimensions must be equal, but are 20 and 13

眉间皱痕 提交于 2019-12-02 07:55:16

Instead of using the BasicRNNCell instance multiple times,one instance per RNN layer should be created - for example in this way:

neurons = [tf.contrib.rnn.BasicRNNCell(num_units=10) for _ in range(nr_layers)]
neurons = tf.contrib.rnn.MultiRNNCell( neurons, state_is_tuple = True )

In addition, there are other mistakes on your codes.rnn_states is a tuple containing cell state and hidden state, and its shape is ((None,10),(None,10)). I assume you want to use hidden state,replace it:

logits = tf.contrib.layers.fully_connected( inputs = rnn_states[1], num_outputs = nr_outputs, activation_fn = None )

That's OK!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!