Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Error on Require autograd #81

Closed
adamw005 opened this issue Jan 15, 2016 · 11 comments
Closed

Error on Require autograd #81

adamw005 opened this issue Jan 15, 2016 · 11 comments

Comments

@adamw005
Copy link

I'm getting this error when trying to use autograd. I used 'luarocks install autograd' to install it.

So far I've tried:

  • reinstalling with luarocks remove autograd
  • luarocks install optim
th> grad = require 'autograd'
/home/ubuntu/torch/install/share/lua/5.1/trepl/init.lua:363: /home/ubuntu/torch/install/share/lua/5.1/trepl/init.lua:363: /home/ubuntu/torch/install/share/lua/5.1/trepl/init.lua:363: ...buntu/torch/install/share/lua/5.1/autograd/nnwrapper.lua:297: bad argument #1 to 'pairs' (table expected, got boolean)
stack traceback:
        [C]: in function 'error'
        /home/ubuntu/torch/install/share/lua/5.1/trepl/init.lua:363: in function 'require'
        [string "grad = require 'autograd'"]:1: in main chunk
        [C]: in function 'xpcall'
        /home/ubuntu/torch/install/share/lua/5.1/trepl/init.lua:648: in function 'repl'
        ...untu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:185: in main chunk
        [C]: at 0x00406670

Link: nnwrapper.lua:297

@alexbw
Copy link
Collaborator

alexbw commented Jan 15, 2016

Try force removing autograd (--force flag) and running "luarocks make" in
the autograd directory instead of luarocks install.
On Thu, Jan 14, 2016 at 7:37 PM adamw005 notifications@github.com wrote:

I'm getting this error when trying to use autograd I used 'luarocks
install autograd' to install it

So far I've tried:

  • reinstalling with luarocks remove autograd
  • luarocks install optim

th> grad = require 'autograd'
/home/ubuntu/torch/install/share/lua/51/trepl/initlua:363: /home/ubuntu/torch/install/share/lua/51/trepl/initlua:363: /home/ubuntu/torch/install/share/lua/51/trepl/initlua:363: buntu/torch/install/share/lua/51/autograd/nnwrapperlua:297: bad argument #1 to 'pairs' (table expected, got boolean)
stack traceback:
[C]: in function 'error'
/home/ubuntu/torch/install/share/lua/51/trepl/initlua:363: in function 'require'
[string "grad = require 'autograd'"]:1: in main chunk
[C]: in function 'xpcall'
/home/ubuntu/torch/install/share/lua/51/trepl/initlua:648: in function 'repl'
untu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:185: in main chunk
[C]: at 0x00406670

Link: nnwrapperlua:297
https://githubcom/twitter/torch-autograd/blob/master/src/nnwrapperlua#L297


Reply to this email directly or view it on GitHub
#81.

@adamw005
Copy link
Author

I keep seeing: Missing dependency for qttorch scm-1: qtlua >= 1.0

.../torch-autograd$ luarocks remove --force autograd
Checking stability of dependencies on the absence of
autograd scm-1...

Removing autograd scm-1...
Missing dependency for qttorch scm-1: qtlua >= 1.0
Removal successful.
git clone https://github.com/twitter/torch-autograd
.../torch-autograd$ luarocks make
cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/home/ubuntu/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1" && make
-- Found Torch7 in /home/ubuntu/torch/install
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/torch/autograd/torch-autograd/build
cd build && make install
Install the project...
-- Install configuration: "Release"
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/support.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/nnwrapper.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/util.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/gradcheck.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/main.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/gradfuns.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/init.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/StringBuilder.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/overload.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/model
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/model/RecurrentNetwork.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/model/SpatialNetwork.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/model/common.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/model/RecurrentLSTMNetwork.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/model/init.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/model/NeuralNetwork.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/model/AlexNet.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/loss
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/loss/init.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/auto
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/auto/AutoModule.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/auto/init.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/auto/AutoCriterion.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/optim
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/optim/init.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/runtime
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/runtime/codegen
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/runtime/codegen/Graph.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/runtime/codegen/Node.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/runtime/codegen/backend
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/runtime/codegen/backend/lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/runtime/codegen/backend/lua/init.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/runtime/codegen/Debugger.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/runtime/codegen/Value.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/runtime/codegen/init.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/runtime/codegen/Source.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/runtime/direct
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/runtime/direct/DirectTape.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/runtime/direct/DirectNode.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/autograd/scm-1/lua/autograd/runtime/direct/init.lua
Updating manifest for /home/ubuntu/torch/install/lib/luarocks/rocks
Missing dependency for qttorch scm-1: qtlua >= 1.0
autograd scm-1 is now built and installed in /home/ubuntu/torch/install/ (license: MIT)

edit: I reinstall Torch and the 'Missing dependency for qttorch scm-1: qtlua >= 1.0' error is gone, but I still get the same original error

@alexbw
Copy link
Collaborator

alexbw commented Jan 15, 2016

Do you have nn installed? Can you post the output of luarocks list

@adamw005
Copy link
Author

Installed rocks:
----------------

alewrap
   0-0 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

argcheck
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

async
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

audio
   0.1-0 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

autograd
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

csv2tensor
   0.2-0 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

csvigo
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

cudnn
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

cunn
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

cunnx
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

cutorch
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

cwrap
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

display
   scm-0 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

dok
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

dp
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

dpnn
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

env
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

fftw3
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

fs
   0.3-0 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

gnuplot
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

graph
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

graphicsmagick
   1.scm-0 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

image
   1.1.alpha-0 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

inn
   1.0-0 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

itorch
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

lbase64
   20120820-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

lua-cjson
   2.1.0-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

luacrypto
   0.3.2-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

luafilesystem
   1.6.3-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

luasocket
   3.0rc1-2 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

lzmq
   0.4.2-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

moses
   1.4.0-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

nn
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

nngraph
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

nnx
   0.1-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

optim
   1.0.5-0 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

paths
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

penlight
   1.3.2-2 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

rnn
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

sdl2
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

signal
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

sundown
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

sys
   1.1-0 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

tds
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

threads
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

torch
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

torchx
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

totem
   0-0 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

trepl
   scm-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

uuid
   0.2-1 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

xitari
   0-0 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

xlua
   1.0-0 (installed) - /home/ubuntu/torch/install/lib/luarocks/rocks

@adamw005
Copy link
Author

I forgot to mention in the op, but util = require 'autograd.util' works fine

@alexbw
Copy link
Collaborator

alexbw commented Jan 15, 2016

What version of Lua are you using? LuaJIT 2.0, 2.1 or Lua 5.1 or 5.2?

@adamw005
Copy link
Author

th> print (_VERSION)
Lua 5.1

@alexbw
Copy link
Collaborator

alexbw commented Jan 16, 2016

LuaJIT will print out the same thing... do you know if you're using LuaJIT or Lua?

@adamw005
Copy link
Author

LuaJIT

th> if type(jit) == 'table' then
..>    print(jit.version) 
..> end
LuaJIT 2.1.0-alpha

@alexbw
Copy link
Collaborator

alexbw commented Jan 22, 2016

I really don't know what to say on this one, I've tried replicating with each version of Lua we support, and can't do it. Best thing I can recommend is for you to completely blow away your Torch install and install from scratch and try again.

@alexbw
Copy link
Collaborator

alexbw commented Mar 7, 2016

If a completely fresh install (removing all Lua + Torch packages and re-installing) doesn't work, try my (alternative Lua distribution)[https://github.com/alexbw/conda-lua-recipes#to-install-packages-warning-this-is-in-flux-quite-a-bit-might-not-be-current].
Reopen this issue if both reinstalling your current distro and trying my alternative one do not work for you.

@alexbw alexbw closed this as completed Mar 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants