blakeMilner / DeepQLearning

A powerful machine learning algorithm utilizing Q-Learning and Neural Networks, implemented using Torch and Lua.
131 stars 59 forks source link

Invalid arguments / not a number error #8

Open rracinskij opened 8 years ago

rracinskij commented 8 years ago

Hello, while trying to test the package I get a following error in test.lua:

/usr/local/bin/luajit: invalid element (not a number) at /tmp/luarocks_torch-scm-1-5698/torch7/generic/Tensor.c:141 stack traceback: [C]: at 0x05e75010 [C]: in function 'Tensor' ./deepqlearn.lua:320: in function 'backward' torch7-qlearn-test01.lua:28: in main chunk [C]: in function 'dofile' /usr/local/lib/luarocks/rocks/trepl/scm-1/bin/th:131: in main chunk [C]: at 0x0105d66930

A simple script with a single forward/backward loop and scalar as a reward gives the same error message after 4 backward calls. However, changing the reward into a tensor(1) results in an error after four backward calls:

/usr/local/bin/luajit: invalid element (not a number) at /tmp/luarocks_torch-scm-1-5698/torch7/generic/Tensor.c:141 stack traceback: [C]: at 0x05e75010 [C]: in function 'Tensor' ./deepqlearn.lua:320: in function 'backward' torch7-qlearn-test01.lua:28: in main chunk [C]: in function 'dofile' /usr/local/lib/luarocks/rocks/trepl/scm-1/bin/th:131: in main chunk [C]: at 0x0105d66930

State is a table, e.g. {1,1}, reward is either a scalar or tensor(1). I'd greatly appreciate any advice on this issue.

rracinskij commented 8 years ago

Update: the deepqlearn.moon code compiled into lua works without errors.