fmassa/optimize-net

not found issuse

youngwanLEE opened this issue · 6 comments

I already installed optnet by using

luarocks install optnet

youngwan@youngwan:~$ sudo luarocks install optnet
Installing https://raw.githubusercontent.com/torch/rocks/master/optnet-scm-1.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/optnet-scm-1.rockspec... switching to 'build' mode
Cloning into 'optimize-net'...
remote: Counting objects: 18, done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 18 (delta 0), reused 9 (delta 0), pack-reused 0
Receiving objects: 100% (18/18), 1.41 MiB | 318.00 KiB/s, done.
Checking connectivity... done.
cmake -E make_directory build;
cd build;
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/usr/bin/.." -DCMAKE_INSTALL_PREFIX="/usr/lib/luarocks/rocks/optnet/scm-1";
make

-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found Torch7 in /usr
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/luarocks_optnet-scm-1-797/optimize-net/build
cd build && make install
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/lib/luarocks/rocks/optnet/scm-1/lua/optnet/utils.lua
-- Installing: /usr/lib/luarocks/rocks/optnet/scm-1/lua/optnet/example.lua
-- Installing: /usr/lib/luarocks/rocks/optnet/scm-1/lua/optnet/models.lua
-- Installing: /usr/lib/luarocks/rocks/optnet/scm-1/lua/optnet/init.lua
-- Installing: /usr/lib/luarocks/rocks/optnet/scm-1/lua/optnet/graphgen.lua
-- Installing: /usr/lib/luarocks/rocks/optnet/scm-1/lua/optnet/env.lua
-- Installing: /usr/lib/luarocks/rocks/optnet/scm-1/lua/optnet/countUsedMemory.lua
-- Installing: /usr/lib/luarocks/rocks/optnet/scm-1/lua/optnet/tests.lua
Updating manifest for /usr/lib/luarocks/rocks
optnet scm-1 is now built and installed in /usr/ (license: BSD)

But this error occured. Because of this problem, I can't execute torch program.

/home/youngwan/torch/install/bin/lua: /home/youngwan/torch/install/share/lua/5.2/trepl/init.lua:384: module 'optnet' not found:No LuaRocks module found for optnet
no field package.preload['optnet']
no file '/home/youngwan/.luarocks/share/lua/5.2/optnet.lua'
no file '/home/youngwan/.luarocks/share/lua/5.2/optnet/init.lua'
no file '/home/youngwan/torch/install/share/lua/5.2/optnet.lua'
no file '/home/youngwan/torch/install/share/lua/5.2/optnet/init.lua'
no file '/home/youngwan/.luarocks/share/lua/5.1/optnet.lua'
no file '/home/youngwan/.luarocks/share/lua/5.1/optnet/init.lua'
no file '/home/youngwan/torch/install/share/lua/5.1/optnet.lua'
no file '/home/youngwan/torch/install/share/lua/5.1/optnet/init.lua'
no file './optnet.lua'
no file '/home/youngwan/torch/install/share/luajit-2.1.0-beta1/optnet.lua'
no file '/usr/local/share/lua/5.1/optnet.lua'
no file '/usr/local/share/lua/5.1/optnet/init.lua'
no file '/home/youngwan/.luarocks/lib/lua/5.2/optnet.so'
no file '/home/youngwan/torch/install/lib/lua/5.2/optnet.so'
no file '/home/youngwan/torch/install/lib/optnet.so'
no file '/home/youngwan/.luarocks/lib/lua/5.1/optnet.so'
no file '/home/youngwan/torch/install/lib/lua/5.1/optnet.so'
no file './optnet.so'
no file '/usr/local/lib/lua/5.1/optnet.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'error'
/home/youngwan/torch/install/share/lua/5.2/trepl/init.lua:384: in function 'require'
train.lua:14: in main chunk
[C]: in function 'dofile'
...gwan/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: in ?

Do you know what this problem is?

You shouldn't be using sudo to install luarocks.

@Kaixhin If I try to install luarocks without sudo, this message is displayed.


> youngwan@youngwan:~$ luarocks install optnet
> Warning: Failed searching manifest: Failed fetching manifest for https://raw.githubusercontent.com/torch/rocks/master - Failed downloading https://raw.githubusercontent.com/torch/rocks/master/manifest - /home/youngwan/.cache/luarocks/https___raw.githubusercontent.com_torch_rocks_master/manifest
> Warning: Failed searching manifest: Failed fetching manifest for https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master - Failed downloading https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/manifest - /home/youngwan/.cache/luarocks/https___raw.githubusercontent.com_rocks-moonscript-org_moonrocks-mirror_master/manifest
> 
> Error: No results matching query were found.

You are installing optnet in a different location than your torch installation.
You can see that by the log that you have sent. You might have two conflicting installations of torch in your machine.
As a workaround, you could do something like

/home/youngwan/torch/install/bin/luarocks install optnet

This will install to the location that you seem to be using when you start th

@fmassa When I tried to install following your instruction, but this error occur again.
Acutally, I just followed http://torch.ch/docs/getting-started.html

youngwan@youngwan:~/torch$ /home/youngwan/torch/install/bin/luarocks install optnet
Warning: Failed searching manifest: Failed fetching manifest for https://raw.githubusercontent.com/torch/rocks/master - Failed downloading https://raw.githubusercontent.com/torch/rocks/master/manifest - /home/youngwan/.cache/luarocks/https___raw.githubusercontent.com_torch_rocks_master/manifest
Warning: Failed searching manifest: Failed fetching manifest for https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master - Failed downloading https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/manifest - /home/youngwan/.cache/luarocks/https___raw.githubusercontent.com_rocks-moonscript-org_moonrocks-mirror_master/manifest

Error: No results matching query were found.

You luarocks is not well configured it seems. I think that the same error will happen if you try to install nn or any other torch package with the command I sent you.
In fact, it is looking for the luarock scripts from moonscript.org, instead of https://github.com/torch/rocks.

One workaround then (but you will need to do it for every package it seems) would be to clone the repo to somewhere (for example /home/youngwan/torch/extra) via

git clone https://github.com/fmassa/optimize-net.git
cd optimize-net
/home/youngwan/torch/install/bin/luarocks make rocks/*

That should work I think.

For a long term solution, I don't know any better solution than removing your current torch folder and re-installing everything. I'd say that you will also need to erase /home/youngwan/.cache/luarocks folder, as it is pointing to the wrong place. :/.

@youngwanLEE did this solve your issue? I'm pretty sure it's not an optnet issue, but instead some conflicts with your luarocks distribution.