Neural-style: Error with cunn and cutorch

Created on 8 Mar 2016  路  11Comments  路  Source: jcjohnson/neural-style

I followed all the steps and it worked perfect until I installed backend for torch. After installing cunn and cutorch, if I do
th -e "require 'cutorch'; require 'cunn'; print(cutorch)"
I get,
faiz@fizz:~/neural-style$ th -e "require 'cutorch'; require 'cunn'; print(cutorch)" /home/faiz/torch/install/share/lua/5.1/trepl/init.lua:384: /home/faiz/torch/install/share/lua/5.1/trepl/init.lua:384: /home/faiz/torch/install/share/lua/5.1/cutorch/test.lua:7: attempt to call field 'TestSuite' (a nil value) faiz@fizz:~/neural-style$

Most helpful comment

I actually had this problem recently; a fresh install of all the core torch packages fixed it for me:

luarocks install torch
luarocks install cutorch
luarocks install nn
luarocks install cunn

All 11 comments

Also receiving this exact error!

Sorry, I got a little excited to see someone else with the same issue.
Let me elaborate somewhat on the exact technical specs:

Running on AWS EC2 Amazon Linux AMI 2015.09.2 x86_64 Graphics HVM EBS.

Working off of torch at this commit

With the following LuaRocks:

  • loadcaffe
  • cutorch
  • cunn
  • cudnn

All on this commit of Neural-Style

Also, the version of CUDA installed on the system is V6.5.12

I tried fresh install, still problem erupts after installing CUDA backend for torch. :(
I'm impatient to get this working!

@jcjohnson @htoyryla any insights you'd like to share?

I actually had this problem recently; a fresh install of all the core torch packages fixed it for me:

luarocks install torch
luarocks install cutorch
luarocks install nn
luarocks install cunn

@jcjohnson Thanks! I'll give it a third try. Also, the only way I can install Nvidia drivers without getting a black screen is if I install restricted driver (v340.96) using the "additional drivers" in Ubuntu. But when I install CUDA, it automatically installs a more recent version of the drivers (something like 352). It surely will cause problems. I was thinking of how can I just install CUDA?
I have Nvidia GeForce 710M, and on the Nvidia's website, it's mentioned that the correct version of the drivers for GeForce 6 & 7 series is 304.131 As my computer faces freezing issues once I install the restricted drivers, I was thinking of installing the correct version using this PPA: https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa

@jcjohnson I've been confronting the issue above and ran:

Environment:

  1. OSX10.11
  2. Xcode 6.2 to be compatible with CUDA 7.5.20
  3. CUDA 7.5.20
  4. cmake 3.5.0
luarocks install torch
luarocks install cutorch

Which sends be back to ./update.sh and then run ./install.sh

Then I'm back to

th> require "cutorch" ...s/matthewdunn/torch/install/share/lua/5.1/trepl/init.lua:384: ...matthewdunn/torch/install/share/lua/5.1/cutorch/init.lua:2: cannot load '/Users/matthewdunn/torch/install/lib/lua/5.1/libcutorch.so' stack traceback: [C]: in function 'error' ...s/matthewdunn/torch/install/share/lua/5.1/trepl/init.lua:384: in function 'require' [string "_RESULT={require "cutorch"}"]:1: in main chunk [C]: in function 'xpcall' ...s/matthewdunn/torch/install/share/lua/5.1/trepl/init.lua:651: in function 'repl' ...dunn/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:199: in main chunk [C]: at 0x01063231d0 [0.0041s] th>

If you have any insight I'd be incredibly thankful as I've been trying to solve this for two weeks and there are several issues open https://github.com/torch/cutorch/issues if you any insight on how to resolve them.

Thanks,

How can I set up cudnn.torch to work with cudnn v3? luarocks install cudnn would work with cudnn v4 if I am not wrong?

@aseembits93 you build the right version of cudnn as follow

git clone https://github.com/soumith/cudnn.torch.git --branch R2
cd cudnn.torch
git branch # display *R2
luarocks remove cudnn # optional
luarocks make

Don't forget to update your LD_LIBRARY_PATH to link to your downloaded version of NVIDIA CUDNN using export (not the torch one, but the one on Nvidia website).

For me a fresh install solved the issue, but I also had to clear the package folders in my ~/.luarocks directory before reinstalling, following the comment: https://github.com/torch/distro/issues/85#issuecomment-199665738

Try sudo bash ./torch/update.sh

Was this page helpful?
0 / 5 - 0 ratings