Element Research - RNN - Sequencer Error

105 views
Skip to first unread message

h3ro...@hotmail.de

unread,
Nov 23, 2015, 11:00:25 AM11/23/15
to torch7
Hallo fellow Torch users,

I have a question about the usage of the Element Research RNN Module.

After a few days of trial I cannot get my model working.
The Error message is:
Sequencer: non-recurrent Module should not
contain a nested recurrent Modules. Recurrent module is nn.FastLSTM. Use a Sequencer instance for each recurrent module. And encapsulate the rest o
f the non-recurrent modules into one or many Sequencers. Yes you can encapsulate many non-recurrent modules in a single Sequencer (as long as they d
on't include recurrent modules.


So I think I get the problem. But I cannot wrap my head around the way it should be done right.

Can anybody see the mistake I make in my model definition?
I can't seen to get it working.

 
local inputsize = imChannel * opt.scale_w * opt.scale_h
 
 
local outputsize_gt = 200
 
local outputsize = opt.scale_w * opt.scale_h
 
 
 
-- parallel 1, rnn 1 --
 
local p1_rnn1 = nn.Sequential()
 
 
for i,modelsize in ipairs(opt.modelsize) do
    p1_rnn1
:add(nn.FastLSTM(inputsize, modelsize))
    p1_rnn1
:add(nn.Dropout(0.20))
    inputsize
= modelsize
 
end
 
 
-- parallel 1, nn 1
 
local p1_nn1 = nn.Sequential()
 
  p1_nn1
:add(nn.Linear(inputsize, outputsize_gt))
 
--p1_rnn2 = nn.Sequential()
 
--p1_rnn1:add(nn.Sequencer(nn.FastLSTM(outputsize, outputsize_gt)))
 
--p1_rnn1:add(nn.Sequencer(nn.Dropout(0.20)))
 
   
 
-- parallel model
 
local innermodel = nn.Parallel(2,1)
 
  innermodel
:add(nn.Sequencer(p1_rnn1))
  innermodel
:add(nn.Sequencer(p1_nn1))
 
 
 
local model = nn.Sequential()
 
-- reshape input
  model
:add(nn.Sequencer(nn.Reshape(opt.scale_w * opt.scale_h, 2)))
  model
:add(nn.Sequencer(innermodel))
 
   
 
-- output layer
  model
:add(nn.Sequencer(nn.Linear(inputsize+outputsize_gt, outputsize))) --modelsize output to generate a picture with same format
  model
:add(nn.Sequencer(nn.Sigmoid()))


Thank you everybody for the help.
Kind regards,
Sebastian

Adam

unread,
Nov 23, 2015, 12:19:18 PM11/23/15
to torch7
I was getting a similar error and simply updating rnn fixed it. 

luarocks install rnn

Reply all
Reply to author
Forward
0 new messages