ROLO icon indicating copy to clipboard operation
ROLO copied to clipboard

Problem with LSTM when running on TensorFlow 0.11

Open terence-vivacity opened this issue 9 years ago • 6 comments

I am trying to reproduce the results of the demo using the pretrained model with the script 'ROLO_network_test_all.py' but I am running into difficulty building the graph using TensorFlow 0.11.

The first issue is the line from tensorflow.models.rnn import rnn, rnn_cell which throws the error message:

Traceback (most recent call last): File "ROLO_network_test_all.py", line 29, in from tensorflow.models.rnn import rnn, rnn_cell File "/usr/local/lib/python2.7/dist-packages/tensorflow/models/rnn/rnn.py", line 21, in raise ImportError("This module is deprecated. Use tf.nn.rnn_* instead.") ImportError: This module is deprecated. Use tf.nn.rnn_* instead.

AS you are already calling tf.nn.rnn and tf.nn.rnn_cell I have commented this line out, but when I do that I get this error message:

WARNING:tensorflow:<tensorflow.python.ops.rnn_cell.LSTMCell object at 0x7f6f88ed0b50>: The input_size parameter is deprecated. Traceback (most recent call last): File "ROLO_network_test_all.py", line 271, in main(' ') File "ROLO_network_test_all.py", line 267, in main ROLO_TF(argvs) File "ROLO_network_test_all.py", line 89, in init self.ROLO(argvs) File "ROLO_network_test_all.py", line 231, in ROLO self.build_networks() File "ROLO_network_test_all.py", line 123, in build_networks self.lstm_module = self.LSTM_single('lstm_test', self.x, self.istate, self.weights, self.biases) File "ROLO_network_test_all.py", line 106, in LSTM_single outputs, state = tf.nn.rnn(cell, [X[step]], state) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn.py", line 226, in rnn (output, state) = call_cell() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn.py", line 213, in call_cell = lambda: cell(input, state) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn_cell.py", line 483, in call (c_prev, m_prev) = state File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 499, in iter raise TypeError("'Tensor' object is not iterable.") TypeError: 'Tensor' object is not iterable.

I tried to troubleshoot the problem myself, but I can't find the solution. I had presumed that the fact that the input_size parameter of the LSTMCell object is deprecated that that was causing some problem further down the line but I am not sure.

What version of TensorFlow did you use when building this code?

terence-vivacity avatar Oct 12 '16 14:10 terence-vivacity

Hello @Guanghan, I'm facing the problem too. Can you update the code or check if it's working?

yenchenlin avatar Oct 18 '16 09:10 yenchenlin

Hi @terence-vivacity and @yenchenlin, the tensorflow API changes since v0.9.0. I tried with TF v0.8.0 and it works

I use this to install tensorflow v0.8.0: export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl

starrysl avatar Oct 26 '16 03:10 starrysl

Hi guys, I am working on a new version of ROLO, and it works with the latest tensorflow version 0.11.0. Haven't figured out how to deal with the deprecated code yet, but will upload the new version first.

Guanghan avatar Nov 01 '16 20:11 Guanghan

Do you have some news about the new commit which will work with tf 11.0?

lvaleriu avatar Nov 15 '16 18:11 lvaleriu

Hi @Guanghan, I cloned the repo and installed Tensorflow 1.1 alongside CUDA Toolkit 8.0 and cuDNN 6.0 but I have had no luck.

Here is the error that I am getting selection_028_v2

Any ideas as to why this might be happening?

WajWaraich avatar Jun 06 '17 21:06 WajWaraich

Hi~@Guanghan,I am using the TensorFlow 0.11-gpu and download your code recently,but meet the same error message as @terence-vivacity,if you have seen this comment ,please help me fix the the second error message:"TypeError: 'Tensor' object is not iterable."

jiangqian0411 avatar Nov 14 '17 04:11 jiangqian0411