hughperkins / distro-cl

OpenCL Torch
147 stars 17 forks source link

attempt to call field 'Unsqueeze' (a nil value) #25

Open bienbinod opened 7 years ago

bienbinod commented 7 years ago

Hi,

I installed this package on my machine successfully and passed all the unit test. But when I run code, it shows following error. I would really appreciate if you could let me know why it is happening. I am new to Torch.

/Users/XXX/torch-cl/install/bin/luajit: ...XXX/torch-cl/install/share/lua/5.1/trepl/init.lua:384: ...dXXX/torch-cl/install/share/lua/5.1/trepl/init.lua:384: ...dXXX/torch-cl/install/share/lua/5.1/rnn/Mufuru.lua:18: attempt to call field 'Unsqueeze' (a nil value) stack traceback: [C]: in function 'error' ...XXXi/torch-cl/install/share/lua/5.1/trepl/init.lua:384: in function 'require' train.lua:1: in main chunk [C]: in function 'dofile' ...i/torch-cl/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk [C]: at 0x0101f889e0'

denyazh commented 7 years ago

You are trying to require a library (rnn) that is trying to call nn.Unsqueeze which is not included in this older nn module. Your code is failing at: require("rnn")

I had the same issue when trying to require Element-Research's rnn module. I did some browsing through their git version tree and managed to find an older version:

git clone https://github.com/Element-Research/rnn.git cd rnn git reset --hard b7ee2fd211 #to switch to the older version of rnn

rm -rf <path to your package install dir>/rnn #to remove the previous installation of rnn cp ./* <path to your package install dir>/rnn I did try using luarocks to install the older rnn version but it kept installing the latest version of rnn for some reason.

This did fix the require error but I have no idea if the rnn module works because I was having another error when training my model related to my AMD card.