viorik/ConvLSTM

Error with model-demo-ConvLSTM.lua : attempt to index global 'opt' (a nil value)

Closed this issue · 2 comments

@viorik, I am getting the above mentioned error whenever I am running the file model-demo-ConvLSTM.lua

Here is the complete error :

/home/ubuntu/torch/install/bin/luajit: model-demo-ConvLSTM.lua:44: attempt to index global 'opt' (a nil value)
stack traceback:
model-demo-ConvLSTM.lua:44: in main chunk
[C]: in function 'dofile'
...untu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:131: in main chunk
[C]: at 0x00406670

Actually I am getting this error whenever I am running any lua file of ConvLSTM that uses opt.
The same error was coming for decoder.lua

After some googling, I found similar question here : http://stackoverflow.com/questions/12161266/why-does-my-lua-class-report-an-attempt-to-index-global-object-error

So, after adding "require opts-mnist" in decoder.lua, the error is gone. But new error comes up on doing so in model-demo-ConvLSTM.lua

/home/ubuntu/torch/install/bin/luajit: model-demo-ConvLSTM.lua:48: attempt to call field 'UntiedConvLSTM' (a nil value)
stack traceback:
model-demo-ConvLSTM.lua:48: in main chunk
[C]: in function 'dofile'
...untu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:131: in main chunk
[C]: at 0x00406670

Kindly look into this!

@ashwani-pandey why do you run the files independently? Normally, the files are run through calls from main-demo-ConvLSTM.lua, where opts-mnist.lua is called before those calls, setting the options in opt. So to run the demo, you need to use qlua main-demo-ConvLSTM.lua. If for debugging purposes you need to run the files independently, then yes, you need to use require opts-mnist in each of the files you want to test separately.

Okay, my bad. I didn't know that.

Thanks!