carlthome/tensorflow-convlstm-cell

Issue while implementing sample code

gaganacharya1995 opened this issue · 1 comments

Hey

I happen to run the sample code mentioned in the README.

import tensorflow as tf

batch_size = 32
timesteps = 100
shape = [640, 480]
kernel = [3, 3]
channels = 3
filters = 12

inputs = tf.placeholder(tf.float32, [batch_size, timesteps] + shape + [channels])

from cell import ConvLSTMCell
cell = ConvLSTMCell(shape, filters, kernel)
outputs, state = tf.nn.dynamic_rnn(cell, inputs, dtype=inputs.dtype)

But I am getting the following error

ValueError: Dimension must be 5 but is 3 for 'transpose_1' (op: 'Transpose') with input shapes: [32,100,640,480,3], [3].

I had done the following changes in cell.py before running the above code:

  1. Replaced tf.nn.rnn_cell with tf.contrib.rnn. I found that my version of tensorflow didn't have tf.nn.rnn_cell. So did this change as it was suggested here: tensorflow/tensorflow#8049

  2. I was getting the following error message

    super(ConvLSTMCell, self).__init__(_reuse=reuse)

TypeError: object.__init__() takes no parameters

So I just commented this line out.

Could you please look into these issues?

You need to update to the latest version of TensorFlow (1.2) and then it will work.