jcjohnson / neural-style

Torch implementation of neural style algorithm
MIT License
18.3k stars 2.71k forks source link

module 'nn' not found #469

Open saeid1 opened 5 years ago

saeid1 commented 5 years ago

hi can you please help me i have flowing error
$ th neural_style.lua -gpu -1 -print_iter 1 /usr/bin/luajit: /usr/share/lua/5.1/trepl/init.lua:389: module 'nn' not found: no field package.preload['nn'] no file './nn.lua' no file '/usr/share/luajit-2.1.0-beta3/nn.lua' no file '/usr/local/share/lua/5.1/nn.lua' no file '/usr/local/share/lua/5.1/nn/init.lua' no file '/usr/share/lua/5.1/nn.lua' no file '/usr/share/lua/5.1/nn/init.lua' no file './nn.so' no file '/usr/local/lib/lua/5.1/nn.so' no file '/usr/lib/x86_64-linux-gnu/lua/5.1/nn.so' no file '/usr/local/lib/lua/5.1/loadall.so' stack traceback: [C]: in function 'error' /usr/share/lua/5.1/trepl/init.lua:389: in function 'require' neural_style.lua:2: in main chunk [C]: in function 'dofile' /usr/lib/torch-trepl/th:149: in main chunk [C]: at 0x556accec81d0

ajhool commented 5 years ago

try luarocks install nn

AndreV84 commented 5 years ago

exactly! plain installation with luarocks should work, highly likely, in my opinion

fuxiao567 commented 4 years ago

hi can you please help me i have flowing error $ th neural_style.lua -gpu -1 -print_iter 1 /usr/bin/luajit: /usr/share/lua/5.1/trepl/init.lua:389: module 'nn' not found: no field package.preload['nn'] no file './nn.lua' no file '/usr/share/luajit-2.1.0-beta3/nn.lua' no file '/usr/local/share/lua/5.1/nn.lua' no file '/usr/local/share/lua/5.1/nn/init.lua' no file '/usr/share/lua/5.1/nn.lua' no file '/usr/share/lua/5.1/nn/init.lua' no file './nn.so' no file '/usr/local/lib/lua/5.1/nn.so' no file '/usr/lib/x86_64-linux-gnu/lua/5.1/nn.so' no file '/usr/local/lib/lua/5.1/loadall.so' stack traceback: [C]: in function 'error' /usr/share/lua/5.1/trepl/init.lua:389: in function 'require' neural_style.lua:2: in main chunk [C]: in function 'dofile' /usr/lib/torch-trepl/th:149: in main chunk [C]: at 0x556accec81d0

I also encountered this problem. Can you solve this problem?

mrgloom commented 4 years ago

sudo luarocks install nn

Installing https://luarocks.org/nn-1.0.5-1.src.rock
gcc -O2 -fPIC -I/usr/include/lua5.1 -c lnn.c -o lnn.o
lnn.c:4:9: fatal error: nanomsg/nn.h: No such file or directory
 #include<nanomsg/nn.h>
         ^~~~~~~~~~~~~~
compilation terminated.

Error: Build error: Failed compiling object lnn.o

sudo apt-get install libnanomsg-dev helped.

AndreV84 commented 4 years ago

luarocks install torch && luarocks install nn source https://github.com/torch/nn/issues/1214