lstm-char-cnn-tensorflow
lstm-char-cnn-tensorflow copied to clipboard
Dimension size must be evenly divisible by 21 but is 1 for 'LSTMTDNN/CNN/Reshape' (op: 'Reshape') with input shapes: [], [2].
when run the 'main.py', encounter this problem.
The problem may be the different version of Tensorflow API.
After
- Upgrading the codes (esp. LSTMDNN.py) to Tensorflow 1.0 using the script in https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/compatibility
- Redefining the _linear in ops.py and LSTMDNN.py Ref: http://stackoverflow.com/questions/42437115/tensorflow-replacement-for-tf-nn-rnn-cell-linearinput-size-0-scope
- Changing calls of tf.nn.rnn_cell to tf.contrib.rnn in LSTMDNN.py tf.nn.rnn_cell.BasicLSTMCell -> tf.contrib.rnn.BasicLSTMCell tf.nn.rnn_cell.MultiRNNCell -> tf.contrib.rnn.MultiRNNCell tf.nn.rnn -> tf.contrib.rnn.static_rnn
I can successfully run the code.
thanks
At 2017-04-12 15:49:52, "dittaya" [email protected] wrote:
The problem may be the different version of Tensorflow API.
After
Upgrading the codes (esp. LSTMDNN.py) to Tensorflow 1.0 using the script in https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/compatibility Redefining the _linear in ops.py and LSTMDNN.py Ref: http://stackoverflow.com/questions/42437115/tensorflow-replacement-for-tf-nn-rnn-cell-linearinput-size-0-scope Changing calls of tf.nn.rnn_cell to tf.contrib.rnn in LSTMDNN.py tf.nn.rnn_cell.BasicLSTMCell -> tf.contrib.rnn.BasicLSTMCell tf.nn.rnn_cell.MultiRNNCell -> tf.contrib.rnn.MultiRNNCell tf.nn.rnn -> tf.contrib.rnn.static_rnn
I can successfully run the code.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
I met the same problem as you did when executing the paper code. Can you tell me how to modify the code in detail?
- Run the script to upgrade the code
- Define
_linearfunction (code copied from the this link) since the new Tensorflow library does not have it. - Replace every
tf.nn.rnn_cellwithtf.contrib.rnn.. and so on.
However, the owner of the project stated that, with this code, this code couldn't reproduce the result in the paper. I've switched to this link instead.
I used the new tf-lstm-char-enn code that you suggested, but the file '../lstm-char-cnn/param_init_.t7' could not be found.
This codes and the new one does not required that file. I can just clone the repository and run their codes.