Code Monkey home page Code Monkey logo

Comments (40)

PaulSchnau avatar PaulSchnau commented on August 17, 2024 5

You should be able to just luarocks install hdf5

from neuraltalk2.

karpathy avatar karpathy commented on August 17, 2024 2

Also, it's unfortunate that so many dependencies are needed. I wonder if it makes sense to create a thin container (e.g. in docker) that has everything installed and can run a CPU forward? Something I might look into over the weekend.

from neuraltalk2.

karpathy avatar karpathy commented on August 17, 2024 1

yay! Thank you @PaulSchnau and @soumith for pitching in - I'm sure this should be helpful to many others who might follow in your path. Closing the issue.

from neuraltalk2.

PaulSchnau avatar PaulSchnau commented on August 17, 2024 1

@jackyliang Try brew install hdf5

from neuraltalk2.

PaulSchnau avatar PaulSchnau commented on August 17, 2024 1

@jackyliang now run luarocks install hdf5

from neuraltalk2.

trych avatar trych commented on August 17, 2024

Okay, wait a second.
I guess, I forgot to download the actual NeuralTalk repository?
So, after I do this, will I just have to put this entire folder somewhere (anywhere?) and when putting $ th eval.lua -model /path/to/model -image_folder /path/to/image/directory -num_images 10 in the Terminal I simply have to point it to the actual path of the eval.lua file? Or does it work differently?

Because when I now try to do that, then it complains that I don't have loadcaffe installed.

/Users/username/torch/install/bin/luajit: /Users/username/torch/install/share/lua/5.1/trepl/init.lua:383: module 'loadcaffe' not found:No LuaRocks module found for loadcaffe

However, in the readme it states that you only need loadcaffe if you want to train your models (which I don't want). If I try to install loadcaffe it gives me this error after a while:

-- Could NOT find PROTOBUF (missing:  PROTOBUF_LIBRARY PROTOBUF_INCLUDE_DIR) 
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
PROTOBUF_LIBRARY (ADVANCED)
    linked by target "loadcaffe" in directory /tmp/luarocks_loadcaffe-1.0-0-9224/loadcaffe

-- Configuring incomplete, errors occurred!
See also "/tmp/luarocks_loadcaffe-1.0-0-9224/loadcaffe/build/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found.  Stop.

Error: Build error: Failed building.

Anybody knows what I am doing wrong here? Please explain in noobish terms. ;)

from neuraltalk2.

PaulSchnau avatar PaulSchnau commented on August 17, 2024

brew install protobuf

from neuraltalk2.

trych avatar trych commented on August 17, 2024

Ok, now I am very confused. I did the brew install protobuf that you suggested, and now when I want to install loadcaffe again it tells me -bash: luarocks: command not found as well as -bash: th: command not found (I had restarted the Terminal in the meantime). Do I need to "activate" torch somehow? Because it did work earlier...

from neuraltalk2.

PaulSchnau avatar PaulSchnau commented on August 17, 2024

Follow the instructions for installing Torch from http://torch.ch/docs/getting-started.html. You should have lua, luarocks, and th when you are done.

from neuraltalk2.

trych avatar trych commented on August 17, 2024

PaulSchnau, thanks for helping me.
That's the instructions I followed.
And luarocks and th did work earlier. Now after restarting they do not work anymore.

I now redid the last step of the installation ( cd ~/torch; ./install.sh ) and in the end it tells me

Not updating your shell profile.
You might want to
add the following lines to your shell profile:

. /Users/username/torch/install/bin/torch-activate

I guess that's what I was missing the first time around. But how do I add this line to "my shell profile", what is my shell profile, where do I find it?

from neuraltalk2.

PaulSchnau avatar PaulSchnau commented on August 17, 2024

Your shell (bash) profile is a set of commands run when you start up bash. Adding that line to your profile will activate torch when you run a th command.

You can manually edit your bash profile using a text editor like vim or nano:
sudo vim ~/.profile
sudo nano ~/.profile

And paste that line in (replacing username with your real username of course). Then you can reload your profile using the command from the Torch install instructions.
source ~/.profile

th commands should then work.

from neuraltalk2.

trych avatar trych commented on August 17, 2024

This works. Although I seem to need to run source ~/.profile every time after I restart the Terminal.
I also successfully installed protobuf, however installing loadcaffe still does not work. It reaches 50% and then stops with this:

[ 50%] Building CXX object CMakeFiles/loadcaffe.dir/loadcaffe.cpp.o
/tmp/luarocks_loadcaffe-1.0-0-8793/loadcaffe/loadcaffe.cpp:152:17: error: no member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char> > > >'
          lines.emplace_back(layer.name(), buf);
          ~~~~~ ^
/tmp/luarocks_loadcaffe-1.0-0-8793/loadcaffe/loadcaffe.cpp:164:17: error: no member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char> > > >'
          lines.emplace_back(layer.name(), buf);

[then 18 more of those...]

fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [CMakeFiles/loadcaffe.dir/loadcaffe.cpp.o] Error 1
make[1]: *** [CMakeFiles/loadcaffe.dir/all] Error 2
make: *** [all] Error 2

What is happening here?

from neuraltalk2.

PaulSchnau avatar PaulSchnau commented on August 17, 2024

Looks like the same issue as szagoruyko/loadcaffe#33

Update your gcc:
brew install gcc
and then try to install loadcaffe again.

from neuraltalk2.

trych avatar trych commented on August 17, 2024

Paul, thanks for bearing with me.
I did that, but still get the same error. Here is the complete "log", in case that helps somehow.

Installing https://raw.githubusercontent.com/torch/rocks/master/loadcaffe-1.0-0.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/loadcaffe-1.0-0.rockspec... switching to 'build' mode
Cloning into 'loadcaffe'...
remote: Counting objects: 18, done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 18 (delta 0), reused 7 (delta 0), pack-reused 0
Receiving objects: 100% (18/18), 18.65 KiB | 0 bytes/s, done.
Checking connectivity... done.
cmake -E make_directory build;
cd build;
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/Users/username/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/Users/username/torch/install/lib/luarocks/rocks/loadcaffe/1.0-0"; 
make

-- The C compiler identification is AppleClang 5.1.0.5030040
-- The CXX compiler identification is AppleClang 5.1.0.5030040
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Torch7 in /Users/username/torch/install
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- Found PROTOBUF: /usr/local/lib/libprotobuf.dylib  
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/luarocks_loadcaffe-1.0-0-2008/loadcaffe/build
[ 25%] Running C++ protocol buffer compiler on caffe.proto
Scanning dependencies of target loadcaffe
[ 50%] Building CXX object CMakeFiles/loadcaffe.dir/loadcaffe.cpp.o
/tmp/luarocks_loadcaffe-1.0-0-2008/loadcaffe/loadcaffe.cpp:152:17: error: no
      member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char>
      > > >'
          lines.emplace_back(layer.name(), buf);
          ~~~~~ ^
/tmp/luarocks_loadcaffe-1.0-0-2008/loadcaffe/loadcaffe.cpp:164:17: error: no
      member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char>
      > > >'
          lines.emplace_back(layer.name(), buf);
          ~~~~~ ^
/tmp/luarocks_loadcaffe-1.0-0-2008/loadcaffe/loadcaffe.cpp:171:17: error: no
      member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char>
      > > >'
          lines.emplace_back(layer.name(), buf);
          ~~~~~ ^
/tmp/luarocks_loadcaffe-1.0-0-2008/loadcaffe/loadcaffe.cpp:228:15: error: no
      member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char>
      > > >'
        lines.emplace_back(layer.name(), buf);
        ~~~~~ ^
/tmp/luarocks_loadcaffe-1.0-0-2008/loadcaffe/loadcaffe.cpp:236:19: error: no
      member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char>
      > > >'
            lines.emplace_back(layer.name(), "cudnn.ReLU(true)");
            ~~~~~ ^
/tmp/luarocks_loadcaffe-1.0-0-2008/loadcaffe/loadcaffe.cpp:239:19: error: no
      member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char>
      > > >'
            lines.emplace_back(layer.name(), "nn.ReLU(true)");
            ~~~~~ ^
/tmp/luarocks_loadcaffe-1.0-0-2008/loadcaffe/loadcaffe.cpp:249:19: error: no
      member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char>
      > > >'
            lines.emplace_back(layer.name(), "cudnn.Tanh(true)");
            ~~~~~ ^
/tmp/luarocks_loadcaffe-1.0-0-2008/loadcaffe/loadcaffe.cpp:252:19: error: no
      member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char>
      > > >'
            lines.emplace_back(layer.name(), "nn.Tanh()");
            ~~~~~ ^
/tmp/luarocks_loadcaffe-1.0-0-2008/loadcaffe/loadcaffe.cpp:262:19: error: no
      member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char>
      > > >'
            lines.emplace_back(layer.name(), "cudnn.Sigmoid(true)");
            ~~~~~ ^
/tmp/luarocks_loadcaffe-1.0-0-2008/loadcaffe/loadcaffe.cpp:265:19: error: no
      member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char>
      > > >'
            lines.emplace_back(layer.name(), "nn.Sigmoid()");
            ~~~~~ ^
/tmp/luarocks_loadcaffe-1.0-0-2008/loadcaffe/loadcaffe.cpp:282:15: error: no
      member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char>
      > > >'
        lines.emplace_back(layer.name(), buf);
        ~~~~~ ^
/tmp/luarocks_loadcaffe-1.0-0-2008/loadcaffe/loadcaffe.cpp:295:19: error: no
      member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char>
      > > >'
            lines.emplace_back("torch_transpose_bdwh", "nn.Transpose({4,...
            ~~~~~ ^
/tmp/luarocks_loadcaffe-1.0-0-2008/loadcaffe/loadcaffe.cpp:296:17: error: no
      member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char>
      > > >'
          lines.emplace_back("torch_view", "nn.View(-1):setNumInputDims(3)");
          ~~~~~ ^
/tmp/luarocks_loadcaffe-1.0-0-2008/loadcaffe/loadcaffe.cpp:298:15: error: no
      member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char>
      > > >'
        lines.emplace_back(layer.name(), buf);
        ~~~~~ ^
/tmp/luarocks_loadcaffe-1.0-0-2008/loadcaffe/loadcaffe.cpp:306:15: error: no
      member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char>
      > > >'
        lines.emplace_back(layer.name(), buf);
        ~~~~~ ^
/tmp/luarocks_loadcaffe-1.0-0-2008/loadcaffe/loadcaffe.cpp:311:15: error: no
      member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char>
      > > >'
        lines.emplace_back(layer.name(), "nn.SoftMax()");
        ~~~~~ ^
/tmp/luarocks_loadcaffe-1.0-0-2008/loadcaffe/loadcaffe.cpp:316:15: error: no
      member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char>
      > > >'
        lines.emplace_back(layer.name(), "nn.SoftMax()");
        ~~~~~ ^
/tmp/luarocks_loadcaffe-1.0-0-2008/loadcaffe/loadcaffe.cpp:400:15: error: no
      member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char>
      > > >'
        lines.emplace_back(layer.name(), buf);
        ~~~~~ ^
/tmp/luarocks_loadcaffe-1.0-0-2008/loadcaffe/loadcaffe.cpp:412:15: error: no
      member named 'emplace_back' in
      'std::vector<std::pair<std::basic_string<char>, std::basic_string<char> >,
      std::allocator<std::pair<std::basic_string<char>, std::basic_string<char>
      > > >'
        lines.emplace_back(layer.name(), buf);
        ~~~~~ ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [CMakeFiles/loadcaffe.dir/loadcaffe.cpp.o] Error 1
make[1]: *** [CMakeFiles/loadcaffe.dir/all] Error 2
make: *** [all] Error 2

Are there any other information I could provide to find out what is going wrong?
Also, am I correct in assuming that contrary to the NeuralTalk readme I actually really need loadcaffe to be installed?

from neuraltalk2.

PaulSchnau avatar PaulSchnau commented on August 17, 2024

I don't know if it will work, but I guess try what they did:
export CC=gcc-4.8
export CXX=g++-4.8

And then install loadcaffe again.

If that doesn't work, you can try getting the CUDA toolkit, even though you won't be able to use it.
https://developer.nvidia.com/cuda-toolkit

from neuraltalk2.

PaulSchnau avatar PaulSchnau commented on August 17, 2024

You can also try removing the require 'loadcaffe' from eval.lua, but I think some of the Tensor models require it.

from neuraltalk2.

trych avatar trych commented on August 17, 2024

Ok, after the export commands, I'm getting this error:

username$ luarocks install loadcaffe
Installing https://raw.githubusercontent.com/torch/rocks/master/loadcaffe-1.0-0.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/loadcaffe-1.0-0.rockspec... switching to 'build' mode
Cloning into 'loadcaffe'...
remote: Counting objects: 18, done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 18 (delta 0), reused 7 (delta 0), pack-reused 0
Receiving objects: 100% (18/18), 18.65 KiB | 0 bytes/s, done.
Checking connectivity... done.
cmake -E make_directory build;
cd build;
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/Users/username/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/Users/username/torch/install/lib/luarocks/rocks/loadcaffe/1.0-0"; 
make

CMake Error at /usr/local/Cellar/cmake/3.4.0/share/cmake/Modules/CMakeDetermineCCompiler.cmake:57 (message):
  Could not find compiler set in environment variable CC:

  gcc-4.8.
Call Stack (most recent call first):
  CMakeLists.txt


CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/tmp/luarocks_loadcaffe-1.0-0-8118/loadcaffe/build/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found.  Stop.

Error: Build error: Failed building.

from neuraltalk2.

PaulSchnau avatar PaulSchnau commented on August 17, 2024

We need to install that specific version of gcc:
brew install gcc48

from neuraltalk2.

trych avatar trych commented on August 17, 2024

This worked! So, now I have successfully installed loadcaffe.
However, when I run the NeuralTalk command, I still get an error:

/Users/username/torch/install/bin/luajit: /Users/username/torch/install/share/lua/5.1/trepl/init.lua:383: module 'misc.utils' not found:No LuaRocks module found for misc.utils
  no field package.preload['misc.utils']
  no file '/Users/username/.luarocks/share/lua/5.1/misc/utils.lua'
  no file '/Users/username/.luarocks/share/lua/5.1/misc/utils/init.lua'
  no file '/Users/username/torch/install/share/lua/5.1/misc/utils.lua'
  no file '/Users/username/torch/install/share/lua/5.1/misc/utils/init.lua'
  no file './misc/utils.lua'
  no file '/Users/username/torch/install/share/luajit-2.1.0-alpha/misc/utils.lua'
  no file '/usr/local/share/lua/5.1/misc/utils.lua'
  no file '/usr/local/share/lua/5.1/misc/utils/init.lua'
  no file '/Users/username/.luarocks/lib/lua/5.1/misc/utils.so'
  no file '/Users/username/torch/install/lib/lua/5.1/misc/utils.so'
  no file './misc/utils.so'
  no file '/usr/local/lib/lua/5.1/misc/utils.so'
  no file '/usr/local/lib/lua/5.1/loadall.so'
  no file '/Users/username/.luarocks/lib/lua/5.1/misc.so'
  no file '/Users/username/torch/install/lib/lua/5.1/misc.so'
  no file './misc.so'
  no file '/usr/local/lib/lua/5.1/misc.so'
  no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
  [C]: in function 'error'
  /Users/username/torch/install/share/lua/5.1/trepl/init.lua:383: in function 'require'
  /Users/username/Downloads/neuraltalk2-master/eval.lua:7: in main chunk
  [C]: in function 'dofile'
  ...username/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
  [C]: at 0x010de83f10

Do I do this correctly actually? I download the entire neuraltalk2 repository, place it whereever (?) and then in the command I provide the entire path to eval.lua? Correct?

from neuraltalk2.

PaulSchnau avatar PaulSchnau commented on August 17, 2024

Cool. You just need to add -gpu -1 to your command because you're not using a GPU.

from neuraltalk2.

trych avatar trych commented on August 17, 2024

(I figure you mean -gpuid -1)

Ok, I feel like we are getting really close, but it still does not quite work.
I downloaded the CPU model, but I still get the same error.

Literally my command is

$ th /Users/username/Desktop/neuraltalk2-master/eval.lua -model /Users/username/Desktop/checkpoint_v1.t7_cpu.t7 -image_folder /Users/username/Desktop/images -num_images 10 -gpuid -1

(Having put all the stuff on my Desktop for demonstration purposes)
Is this correct at all? Or am I doing something wrong there?

The error is this:

/Users/username/torch/install/bin/luajit: /Users/username/torch/install/share/lua/5.1/trepl/init.lua:383: module 'misc.utils' not found:No LuaRocks module found for misc.utils
  no field package.preload['misc.utils']
  no file '/Users/username/.luarocks/share/lua/5.1/misc/utils.lua'
  no file '/Users/username/.luarocks/share/lua/5.1/misc/utils/init.lua'
  no file '/Users/username/torch/install/share/lua/5.1/misc/utils.lua'
  no file '/Users/username/torch/install/share/lua/5.1/misc/utils/init.lua'
  no file './misc/utils.lua'
  no file '/Users/username/torch/install/share/luajit-2.1.0-alpha/misc/utils.lua'
  no file '/usr/local/share/lua/5.1/misc/utils.lua'
  no file '/usr/local/share/lua/5.1/misc/utils/init.lua'
  no file '/Users/username/.luarocks/lib/lua/5.1/misc/utils.so'
  no file '/Users/username/torch/install/lib/lua/5.1/misc/utils.so'
  no file './misc/utils.so'
  no file '/usr/local/lib/lua/5.1/misc/utils.so'
  no file '/usr/local/lib/lua/5.1/loadall.so'
  no file '/Users/username/.luarocks/lib/lua/5.1/misc.so'
  no file '/Users/username/torch/install/lib/lua/5.1/misc.so'
  no file './misc.so'
  no file '/usr/local/lib/lua/5.1/misc.so'
  no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
  [C]: in function 'error'
  /Users/username/torch/install/share/lua/5.1/trepl/init.lua:383: in function 'require'
  /Users/username/Desktop/neuraltalk2-master/eval.lua:7: in main chunk
  [C]: in function 'dofile'
  ...username/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
  [C]: at 0x0106ea8f10

from neuraltalk2.

trych avatar trych commented on August 17, 2024

Is it correct to just download the neuraltalk2-master folder, or do I need to "install" it somehow?

from neuraltalk2.

soumith avatar soumith commented on August 17, 2024

do this:

cd /Users/username/Desktop/neuraltalk2-master/
th eval.lua  -model /Users/username/Desktop/checkpoint_v1.t7_cpu.t7 -image_folder /Users/username/Desktop/images -num_images 10 -gpuid -1

from neuraltalk2.

PaulSchnau avatar PaulSchnau commented on August 17, 2024

Looks like eval.lua isn't finding the local file https://github.com/karpathy/neuraltalk2/blob/master/misc/utils.lua

soumith's suggestion of cd-ing into the project directory first should work.

from neuraltalk2.

trych avatar trych commented on August 17, 2024

Now it complains that hdf5 is missing. Is hdf5 necessary to make it work?

/Users/username/torch/install/bin/luajit: /Users/username/torch/install/share/lua/5.1/trepl/init.lua:383: /Users/username/torch/install/share/lua/5.1/trepl/init.lua:383: module 'hdf5' not found:No LuaRocks module found for hdf5
  no field package.preload['hdf5']
  no file '/Users/username/.luarocks/share/lua/5.1/hdf5.lua'
  no file '/Users/username/.luarocks/share/lua/5.1/hdf5/init.lua'
  no file '/Users/username/torch/install/share/lua/5.1/hdf5.lua'
  no file '/Users/username/torch/install/share/lua/5.1/hdf5/init.lua'
  no file './hdf5.lua'
  no file '/Users/username/torch/install/share/luajit-2.1.0-alpha/hdf5.lua'
  no file '/usr/local/share/lua/5.1/hdf5.lua'
  no file '/usr/local/share/lua/5.1/hdf5/init.lua'
  no file '/Users/username/.luarocks/lib/lua/5.1/hdf5.so'
  no file '/Users/username/torch/install/lib/lua/5.1/hdf5.so'
  no file './hdf5.so'
  no file '/usr/local/lib/lua/5.1/hdf5.so'
  no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
  [C]: in function 'error'
  /Users/username/torch/install/share/lua/5.1/trepl/init.lua:383: in function 'require'
  eval.lua:8: in main chunk
  [C]: in function 'dofile'
  ...username/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
  [C]: at 0x010dd78f10

When I try to install it with these steps

brew tap homebrew/science
brew install hdf5
git clone [email protected]:deepmind/torch-hdf5.git
cd torch-hdf5
luarocks make hdf5-0-0.rockspec

Then at the step git clone [email protected]:deepmind/torch-hdf5.git it gives me this error:

Cloning into 'torch-hdf5'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Where does this repository need to exist?

from neuraltalk2.

trych avatar trych commented on August 17, 2024

Yeeeeeeeeeees!!!!!
"a man is holding a frisbee in front of a crowd"
Success, it works!

Paul, thank you SO much! Really, really appreciate your patience with a beginner like me. I got it to work at last and can now finally go to sleep happily at 5.30 am local time. Phew. Without you I would have given up long ago.

Thank you!

from neuraltalk2.

trych avatar trych commented on August 17, 2024

There is one litte question left (even though the issue is correctly closed already): Why do I have to reload th and luarocks via source ~/.profile everytime after restarting the terminal? Is there a way to remember it, so I don't have to do this manually?

from neuraltalk2.

beeva-enriqueotero avatar beeva-enriqueotero commented on August 17, 2024

My two cents. Trying to solve dependency issues with docker: https://github.com/beeva-enriqueotero/docker-neuraltalk2
At the moment it works for CPU, not for GPU
Thanks for this awesome project!

from neuraltalk2.

karpathy avatar karpathy commented on August 17, 2024

Thanks @beeva-enriqueotero , I don't have too much experience with docker (still on my todo list to dive into properly). Does it work? If you could put some info into the Readme I'd be happy to link to this repo.

from neuraltalk2.

brutuselvis avatar brutuselvis commented on August 17, 2024

I have a similar issue on my mac running the eval lua command (th eval.lua -model .. /model_id1-501-1448236541.t7 -image_folder .. /img -num_images 1) on a small folder of ten images.

I am in the neurotalk2 folder but nonetheless I get:

/Users/localadmin/torch/install/bin/luajit: ...rs/localadmin/torch/install/share/lua/5.1/trepl/init.lua:383: module 'misc.utils' not found:No LuaRocks module found for misc.utils
no field package.preload['misc.utils']
no file '/Users/localadmin/.luarocks/share/lua/5.1/misc/utils.lua'
no file '/Users/localadmin/.luarocks/share/lua/5.1/misc/utils/init.lua'
no file '/Users/localadmin/torch/install/share/lua/5.1/misc/utils.lua'
no file '/Users/localadmin/torch/install/share/lua/5.1/misc/utils/init.lua'
no file './misc/utils.lua'
no file '/Users/localadmin/torch/install/share/luajit-2.1.0-beta1/misc/utils.lua'
no file '/usr/local/share/lua/5.1/misc/utils.lua'
no file '/usr/local/share/lua/5.1/misc/utils/init.lua'
no file '/Users/localadmin/.luarocks/lib/lua/5.1/misc/utils.so'
no file '/Users/localadmin/torch/install/lib/lua/5.1/misc/utils.so'
no file './misc/utils.so'
no file '/usr/local/lib/lua/5.1/misc/utils.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file '/Users/localadmin/.luarocks/lib/lua/5.1/misc.so'
no file '/Users/localadmin/torch/install/lib/lua/5.1/misc.so'
no file './misc.so'
no file '/usr/local/lib/lua/5.1/misc.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'error'
...rs/localadmin/torch/install/share/lua/5.1/trepl/init.lua:383: in function 'require'
eval.lua:7: in main chunk
[C]: in function 'dofile'
...dmin/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x010f243bc0

Any suggestions what I m doing wrong?

I traced back all the steps (except pointing the library path to the cudnn - I didn not get that).

from neuraltalk2.

beeva-enriqueotero avatar beeva-enriqueotero commented on August 17, 2024

I've just updated Readme info on https://github.com/beeva-enriqueotero/docker-neuraltalk2 with instructions to launch a docker container with neuraltalk2.
It works only for CPU mode (-gpuid -1)

from neuraltalk2.

brutuselvis avatar brutuselvis commented on August 17, 2024

Could you add one for gpu mode? I m trying to run the livecam version

edit: sorry saw the ToDo just now. Any suggestions on my error though? I ve now added the cudnn lib to the admin path.

from neuraltalk2.

jackyliang avatar jackyliang commented on August 17, 2024

Hi @PaulSchnau - thanks so much for assisting.

I just tried running luarocks install hdf5, however, the error I am getting is:

Installing https://raw.githubusercontent.com/torch/rocks/master/hdf5-20-0.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/hdf5-20-0.rockspec... switching to 'build' mode
Cloning into 'torch-hdf5'...
remote: Counting objects: 44, done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 44 (delta 3), reused 23 (delta 2), pack-reused 0
Receiving objects: 100% (44/44), 28.23 KiB | 0 bytes/s, done.
Resolving deltas: 100% (3/3), done.
Checking connectivity... done.
cmake -E make_directory build;
cd build;
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/Users/loop/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/Users/loop/torch/install/lib/luarocks/rocks/hdf5/20-0";
make

-- The C compiler identification is AppleClang 6.1.0.6020053
-- The CXX compiler identification is AppleClang 6.1.0.6020053
-- 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 /Users/loop/torch/install
CMake Error at /usr/local/Cellar/cmake/3.0.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:136 (message):
  Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS) (Required
  is at least version "1.8")
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.0.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/Cellar/cmake/3.0.2/share/cmake/Modules/FindHDF5.cmake:360 (find_package_handle_standard_args)
  CMakeLists.txt:4 (FIND_PACKAGE)


-- Configuring incomplete, errors occurred!
See also "/tmp/luarocks_hdf5-20-0-7034/torch-hdf5/build/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found.  Stop.

Error: Build error: Failed building.

Looks like it is failing to find HDF5

from neuraltalk2.

jackyliang avatar jackyliang commented on August 17, 2024

@PaulSchnau I just tried this - hdf5 seems to be successfully installed by Homebrew:

     ~/MacPorts-2.3.3    brew install homebrew/science/hdf5
==> Tapping homebrew/science
Cloning into '/usr/local/Library/Taps/homebrew/homebrew-science'...
remote: Counting objects: 571, done.
remote: Compressing objects: 100% (570/570), done.
remote: Total 571 (delta 2), reused 53 (delta 0), pack-reused 0
Receiving objects: 100% (571/571), 470.59 KiB | 0 bytes/s, done.
Resolving deltas: 100% (2/2), done.
Checking connectivity... done.
Tapped 564 formulae (592 files, 1.5M)
==> Installing hdf5 from homebrew/science
==> Installing dependencies for homebrew/science/hdf5: szip
==> Installing homebrew/science/hdf5 dependency: szip
==> Downloading https://homebrew.bintray.com/bottles/szip-2.1.yosemite.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring szip-2.1.yosemite.bottle.1.tar.gz
🍺  /usr/local/Cellar/szip/2.1: 9 files, 109.5K
==> Installing homebrew/science/hdf5
==> Downloading https://homebrew.bintray.com/bottles-science/hdf5-1.8.16_1.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring hdf5-1.8.16_1.yosemite.bottle.tar.gz
🍺  /usr/local/Cellar/hdf5/1.8.16_1: 176 files, 10.5M

However, running this again:

 ~/neuraltalk2  ⑂ master    th eval.lua -model ~/Downloads/ms_coco.t7 -image_folder ~/Desktop/fs/ -num_images 17
/Users/loop/torch/install/bin/luajit: /Users/loop/torch/install/share/lua/5.1/trepl/init.lua:383: /Users/loop/torch/install/share/lua/5.1/trepl/init.lua:383: module 'hdf5' not found:No LuaRocks module found for hdf5
    no field package.preload['hdf5']
    no file '/Users/loop/.luarocks/share/lua/5.1/hdf5.lua'
    no file '/Users/loop/.luarocks/share/lua/5.1/hdf5/init.lua'
    no file '/Users/loop/torch/install/share/lua/5.1/hdf5.lua'
    no file '/Users/loop/torch/install/share/lua/5.1/hdf5/init.lua'
    no file './hdf5.lua'
    no file '/Users/loop/torch/install/share/luajit-2.1.0-beta1/hdf5.lua'
    no file '/usr/local/share/lua/5.1/hdf5.lua'
    no file '/usr/local/share/lua/5.1/hdf5/init.lua'
    no file '/Users/loop/.luarocks/lib/lua/5.1/hdf5.so'
    no file '/Users/loop/torch/install/lib/lua/5.1/hdf5.so'
    no file '/Users/loop/torch/install/lib/hdf5.dylib'
    no file './hdf5.so'
    no file '/usr/local/lib/lua/5.1/hdf5.so'
    no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
    [C]: in function 'error'
    /Users/loop/torch/install/share/lua/5.1/trepl/init.lua:383: in function 'require'
    eval.lua:8: in main chunk
    [C]: in function 'dofile'
    ...loop/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
    [C]: at 0x010b42ad60

from neuraltalk2.

jackyliang avatar jackyliang commented on August 17, 2024

@PaulSchnau Thank you for such a quick reply - you are awesome.

Now torch is telling me I am missing cutorch, so I typed in the following:

 ~/neuraltalk2  ⑂ master    luarocks install cutorch

Installing https://raw.githubusercontent.com/torch/rocks/master/cutorch-scm-1.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/cutorch-scm-1.rockspec... switching to 'build' mode
Cloning into 'cutorch'...
remote: Counting objects: 104, done.
remote: Compressing objects: 100% (98/98), done.
remote: Total 104 (delta 8), reused 42 (delta 3), pack-reused 0
Receiving objects: 100% (104/104), 146.18 KiB | 0 bytes/s, done.
Resolving deltas: 100% (8/8), done.
Checking connectivity... done.
cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/Users/loop/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/Users/loop/torch/install/lib/luarocks/rocks/cutorch/scm-1" && make -j$(getconf _NPROCESSORS_ONLN) install

-- The C compiler identification is AppleClang 6.1.0.6020053
-- The CXX compiler identification is AppleClang 6.1.0.6020053
-- 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 /Users/loop/torch/install
CMake Error at /usr/local/Cellar/cmake/3.0.2/share/cmake/Modules/FindCUDA.cmake:568 (message):
  Specify CUDA_TOOLKIT_ROOT_DIR
Call Stack (most recent call first):
  CMakeLists.txt:7 (FIND_PACKAGE)


-- Configuring incomplete, errors occurred!
See also "/tmp/luarocks_cutorch-scm-1-734/cutorch/build/CMakeFiles/CMakeOutput.log".

Error: Build error: Failed building.

EDIT: Tried adding -gpuid -1 since I am running purely on CPU, however, got the following error: unknown Torch class <torch.CudaTensor>

from neuraltalk2.

jackyliang avatar jackyliang commented on August 17, 2024

I just fixed it - turns out I was using the GPU models instead of the CPU model.

from neuraltalk2.

jackyliang avatar jackyliang commented on August 17, 2024

I am trying to locate the string "Camera Dropped Frame" as I am using text-to-speech on NeuralTalk2, and I do not need the "Camera Dropped Frame" text but doing a grep of both the library on Github and on my machine, I couldn't locate this string, making me think this may be a language thing. How do I remove this string? @PaulSchnau

from neuraltalk2.

wzyflyleaf avatar wzyflyleaf commented on August 17, 2024

@PaulSchnau
my operating system is Mac

  1. brew install hdf5
  2. luarocks install hdf5, then i met the following error.
    Could NOT find HDF5 (missing: HDF5_HL_LIBRARIES) (found suitable version
    "1.8.16", minimum required is "1.8")

can someone help me? any suggestion is appreciated!

from neuraltalk2.

sebastianquack avatar sebastianquack commented on August 17, 2024

Hi all. Thanks for the super helpful thread. I'm encountering the same issue with luarocks install hdf5 as wzyflyleaf
(OS X 10.11.5, brew install hdf5 works, luarocks install hdf5 fails).

from neuraltalk2.

lizekui avatar lizekui commented on August 17, 2024

@wzyflyleaf @sebastianquack Well, finally I encounter this trouble.
After
yum install hdf5 & luarocks install hdf5
I meet

 " CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message): 
  Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS) (Required is at least version "1.8") "

I firstly run command find / -name hdf5* , try to find somewhere called "hdf5/lib" , but unfortunately nothing found ,
Secondly, I yum search this software, find there are

hdf5-devel.x86_64 : HDF5 development files
hdf5-mpich.x86_64 : HDF5 mpich libraries
hdf5-mpich-devel.x86_64 : HDF5 mpich development files
hdf5-mpich-static.x86_64 : HDF5 mpich static libraries
hdf5-openmpi.x86_64 : HDF5 openmpi libraries
hdf5-openmpi-devel.x86_64 : HDF5 openmpi development files
hdf5-openmpi-static.x86_64 : HDF5 openmpi static libraries
hdf5-static.x86_64 : HDF5 static libraries
h5py.x86_64 : A Python interface to the HDF5 library
hdf5.x86_64 : A general purpose library and file format for storing scientific data

I run
yum install hdf5-static
and then
'luarocks install hdf5'

BUILD PASS~

from neuraltalk2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.