jcjohnson / neural-style

Torch implementation of neural style algorithm
MIT License
18.31k stars 2.7k forks source link

Backend cudnn problem. #284

Open lgs777 opened 8 years ago

lgs777 commented 8 years ago

I'm using cuda toolkit 7.5 and cudnn 5.1 for cuda 7.5. When I have problem with "-backend cudnn" plz help me.

home/goonseob/neuralst/neural-style# sudo th neural_style.lua -print_iter 10 -save_iter 200 -num_iterations 800 -image_size 700 -style_image Pablo_Picasso1.jpg -content_image lgs2.JPG -output_image 3333333.png -gpu 1 -style_weight 1500 -content_weight 600 -init image -normalize_gradients -style_scale 1.0 -backend cudnn nil /usr/local/bin/luajit: /usr/local/share/lua/5.1/trepl/init.lua:384: /usr/local/share/lua/5.1/trepl/init.lua:384: /usr/local/share/lua/5.1/cudnn/ffi.lua:1598: 'libcudnn (R5) not found in library path. Please install CuDNN from https://developer.nvidia.com/cuDNN Then make sure files named as libcudnn.so.5 or libcudnn.5.dylib are placed in your library load path (for example /usr/local/lib , or manually add a path to LD_LIBRARY_PATH)

stack traceback: [C]: in function 'error' /usr/local/share/lua/5.1/trepl/init.lua:384: in function 'require' neural_style.lua:64: in function 'main' neural_style.lua:500: in main chunk [C]: in function 'dofile' /usr/local/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk [C]: at 0x00406260 root@goonseob-To-be-filled-by-O-E-M:/home/goonseob/neuralst/neural-style#

jcjohnson commented 8 years ago

You need to make sure that the libcudnn.so.5 file is in one of the directories specified by the LD_LIBRARY_PATH environment variable.

To check your LD_LIBRARY_PATH, type the following in a terminal:

echo $LD_LIBRARY_PATH

If CUDA is working then your CUDA install directory should already be here; for example on Ubuntu CUDA libraries are usually in /usr/local/cuda/lib64; that is a good place to put the cuDNN libraries.

toniaguirre commented 8 years ago

@jcjohnson

I have the same error, for CUDA 7 and cudnn 4. I get the same

 libcudnn (R5) not found in library path.
Please install CuDNN from https://developer.nvidia.com/cuDNN
Then make sure files named as libcudnn.so.5 or libcudnn.5.dylib are placed in your library load path (for example /usr/local/lib , or manually add a path to LD_LIBRARY_PATH)"

When I run that echo $LD_LIBRARY_PATH I get /usr/local/cuda-7.0/lib64:/home/ubuntu/torch/install/lib:/home/ubuntu/torch/install/lib:/usr/local/cuda-7.0/lib64/:

What should I do now? (Please, I am new to Ubuntu, so I would appreciate easy-to-follow instructions :)) Thanks!

rayset commented 8 years ago

it may help you: https://github.com/jcjohnson/neural-style/issues/319 I had the exact same setup and problem.