Element-Research / rnn

Recurrent Neural Network library for Torch7's nn
BSD 3-Clause "New" or "Revised" License
941 stars 313 forks source link

SeqLSTM with nngraph Gives "Only Batchmode Supported Error" #349

Open prateepcs4 opened 8 years ago

prateepcs4 commented 8 years ago

Currently, I have a nn.gModule wrapped around with a nn.Sequencer module. The gModule takes as input a table consisting of two tensors each having size (batchSize, 3, 224, 224) and outputs a Tensor of size (batchSize, 1000). So, when decorated with the sequencer I am passing the input as a table of length SeqLen containing the input tables I previously mentioned. In the output, I am getting a table of size SeqLen containing SeqLen tensors of size (batchSize, 1000). When I am trying to pass this to a nn.SeqLSTM layer I am getting an error written as 'only batch mode supported'. I think the input to nn.SeqLSTM should be a tensor of size (seqLen, batchSize, 1000) whereas here it is a table holding those tensors of size (batchSize, 1000). Is there any possible module which can change this table to the required tensor? Please help me on this.

@nicholas-leonard