New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A bug when applying MultiRNNCell? #16186
Comments
I had the same problem and found how to solve it.
|
As said by @peytonhong , |
No, I don't think it is a bug. The problem was came from a misunderstanding about the structure of TensorFlow. |
Hi, I encountered the same problem. After searching issues, I found many users have the same difficulties to construct MultiCellRNN correctly. So I did some code trace and explained what I understood from code in this Stackflow post https://stackoverflow.com/questions/48865554/using-dynamic-rnn-with-multirnn-gives-error/49066981#49066981 |
System information
You can collect some of this information using our environment capture script:
https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh
You can obtain the TensorFlow version with
python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"
Describe the problem
tf.nn.MultiRNNCell sometimes doesn't work.
It raises an issue like this:
ValueError: Dimensions must be equal, but are 64 and 96 for 'lstm/rnn/while/rnn/multi_rnn_cell/cell_0/cell_0/basic_lstm_cell/MatMul_1' (op: 'MatMul') with input shapes: [128,64], [96,128].
Source code / logs
import tensorflow as tf
import numpy as np
hidden_layer_size = 32
embed = tf.zeros((128, 6, 64), dtype=tf.float32)
num_LSTM_layers = 2
with tf.variable_scope("lstm"):
Error:
ValueError: Dimensions must be equal, but are 64 and 96 for 'lstm/rnn/while/rnn/multi_rnn_cell/cell_0/cell_0/basic_lstm_cell/MatMul_1' (op: 'MatMul') with input shapes: [128,64], [96,128].
The text was updated successfully, but these errors were encountered: