jcjohnson / densecap

Dense image captioning in Torch
MIT License
1.58k stars 432 forks source link

Module 'torch-rnn' not found #64

Open baricks opened 7 years ago

baricks commented 7 years ago

Hi,

Newbie here. I'm trying to get densecap running on the pre-trained model but my system can't seem to locate the torch-rnn module. I suspect something's up with the pathways.

I run:

th run_model.lua -input_image imgs/elephant.jpg -gpu -1

This is the error I'm getting:

/Users/rebeccaricks/torch/install/bin/luajit: .../rebeccaricks/torch/install/share/lua/5.1/trepl/init.lua:389: .../rebeccaricks/torch/install/share/lua/5.1/trepl/init.lua:389: .../rebeccaricks/torch/install/share/lua/5.1/trepl/init.lua:389: module 'torch-rnn' not found:No LuaRocks module found for torch-rnn
    no field package.preload['torch-rnn']
    no file '/Users/rebeccaricks/.luarocks/share/lua/5.1/torch-rnn.lua'
    no file '/Users/rebeccaricks/.luarocks/share/lua/5.1/torch-rnn/init.lua'
    no file '/Users/rebeccaricks/torch/install/share/lua/5.1/torch-rnn.lua'
    no file '/Users/rebeccaricks/torch/install/share/lua/5.1/torch-rnn/init.lua'
    no file './torch-rnn.lua'
    no file '/Users/rebeccaricks/torch/install/share/luajit-2.1.0-beta1/torch-rnn.lua'
    no file '/usr/local/share/lua/5.1/torch-rnn.lua'
    no file '/usr/local/share/lua/5.1/torch-rnn/init.lua'
    no file '/Users/rebeccaricks/.luarocks/lib/lua/5.1/torch-rnn.so'
    no file '/Users/rebeccaricks/torch/install/lib/lua/5.1/torch-rnn.so'
    no file '/Users/rebeccaricks/torch/install/lib/torch-rnn.dylib'
    no file './torch-rnn.so'
    no file '/usr/local/lib/lua/5.1/torch-rnn.so'
    no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
    [C]: in function 'error'
    .../rebeccaricks/torch/install/share/lua/5.1/trepl/init.lua:389: in function 'require'
    run_model.lua:5: in main chunk
    [C]: in function 'dofile'
    ...icks/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
    [C]: at 0x0108d59cf0
corbinyo commented 7 years ago

run this command again: luarocks install https://raw.githubusercontent.com/jcjohnson/torch-rnn/master/torch-rnn-scm-1.rockspec I had the same issue. Perhaps it updates the dependency.

corbinyo commented 7 years ago

Additionally - I had this error when trying to run the model on files in a folder:

PANIC: unprotected error in call to Lua API (not enough memory)

So, I updated lua with: cd ~/torch ./clean.sh TORCH_LUA_VERSION=LUA52 ./install.sh

and then updated these: luarocks install https://raw.githubusercontent.com/qassemoquab/stnbhwd/master/stnbhwd-scm-1.rockspec luarocks install https://raw.githubusercontent.com/jcjohnson/torch-rnn/master/torch-rnn-scm-1.rockspec

and I could run the model again perfectly.