Giter Club home page Giter Club logo

Comments (7)

iwyoo avatar iwyoo commented on September 3, 2024 1

Sorry for missing the example code. I now add an example code in README.md that I used before.

  1. Usually, input of convolution layer has 4-dimension, [batch, height, width, channel]. arg_size is channel size. (An example of channel is RGB.)
  2. Please read my code in README.md. The input shape of each cell is [batch, height, width, channel].

I'll left this issue open, if you have any question more, then comment it. If not, close this issue. Thank you!

from convlstmcell-tensorflow.

anxingle avatar anxingle commented on September 3, 2024

@iwyoo Thanks a million!

from convlstmcell-tensorflow.

anxingle avatar anxingle commented on September 3, 2024
     x = tf.placeholder(tf.float32, [batch_size, height, width, nsteps, channel])
     _Hsplit = tf.split(3, _nsteps, _X)
     #shape: step_size *[None,height,width,channel]
     _Hsplit = [tf.squeeze(p_input,[3]) for p_input in _Hsplit]
     with tf.variable_scope(_name):
         lstm_cell = convLSTM(dimhidden,forget_bias=1.0,\
                           state_is_tuple=True)
        #lstm_cell = tf.nn.rnn_cell.DropoutWrapper(lstm_cell, input_keep_prob=0.5,\
        #                 output_keep_prob=0.5)
        state     = lstm_cell.zero_state(batch_size,height,width)
        #lstm_cell = tf.nn.rnn_cell.MultiRNNCell([lstm_cell]*num_layers,\
        #	                             state_is_tuple=True)
        outputs = []
        for input_ in _Hsplit:
            output,state = lstm_cell(input_,state)
            outputs.append(output)
        result_out = []
        state_h     = lstm_cell.zero_state(batch_size,height,width)
        for output_ in outputs:
            out,state_h  = lstm_cell(output_,state_h)
            result_out.append(out)
        #_LSTM_O, _LSTM_S = tf.nn.rnn(lstm_cell, _Hsplit, \
        #	                             initial_state=state)
        return result_out

I cann't use "DropoutWrapper" and "MultiRNNCell" and "tf.nn.rnn". So I rewrite the same functions to replace the "tf.nn.rnn" . But I got that :
File "lstm_ctc_ori.py", line 84, in RNN
output,state = lstm_cell(input
,state)
File "/mnt/d/workspace/ubuntu/experiment_recog/convLstm/ConvLSTMCell.py", line 70, in call
c, h = state
File "/mnt/d/workspace/ubuntu/tf/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 495, in iter
raise TypeError("'Tensor' object is not iterable.")
TypeError: 'Tensor' object is not iterable. I want to feed to the network pictures like this:
captcha

from convlstmcell-tensorflow.

iwyoo avatar iwyoo commented on September 3, 2024

I have not checked that existing implementations are compatible with those provided by TensorFlow because they use different operators. I will try to implement it as soon as I can. The layers mentioned above (DropoutWrapper, MultiRNNCell, tf.nn.rnn) can be stacked directly as a block using ConvLSTMCell. If you are in a hurry, I suggest you implement it in such a way. (I've done similar experiments in the past.)
When I read the contents of the error, it seems to be caused by the difference between the past version and the current version. (With is_state_stuple variable) I am going to implement it by referring to the current Tensorflow version implementation. But I can not confirm how long it will take.

from convlstmcell-tensorflow.

anxingle avatar anxingle commented on September 3, 2024

Ok. I will try to implement it and your implementation of the ConvLSTM do give me a lot help. Thank you .

from convlstmcell-tensorflow.

rogertrullo avatar rogertrullo commented on September 3, 2024

Hi @iwyoo , thanks for sharing your implementation! In the example provided in the README, it is written this:
t_output, state = cell(p_input_, state, k_size)
I think the k_size parameter, should be actually the scope name. Shouldn't it?

from convlstmcell-tensorflow.

iwyoo avatar iwyoo commented on September 3, 2024

Oh, thanks for noticing me. The README file was the old version. Now, it is fixed.

from convlstmcell-tensorflow.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.