xinyadu / nqg

neural question generation for reading comprehension

Home Page:https://arxiv.org/abs/1705.00106

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

th preprocess.lua -config config-preprocess - ERROR

SundeepPidugu opened this issue · comments

I have this issue while running th preprocess.lua -config config-preprocess

/usr/bin/luajit: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua:389: /usr/share/lua/5.1/trepl/init.lua
:389: /usr/share/lua/5.1/trepl/init.lua:389: module 'nngraph' not found:
no field package.preload['nngraph']
no file './nngraph.lua'
no file '/usr/share/luajit-2.1.0-beta3/nngraph.lua'
no file '/usr/local/share/lua/5.1/nngraph.lua'
no file '/usr/local/share/lua/5.1/nngraph/init.lua'
no file '/usr/share/lua/5.1/nngraph.lua'
no file '/usr/share/lua/5.1/nngraph/init.lua'
no file './nngraph.so'
no file '/usr/local/lib/lua/5.1/nngraph.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.1/nngraph.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'
preprocess.lua:1: in main chunk
[C]: in function 'dofile'
/usr/lib/torch-trepl/th:149: in main chunk
[C]: at 0x55bd871591d0

How do i fix it ?

Try running the following
#for Torch with Lua 5.3:
import os
os.environ['LUA_PATH'] = '/root/.luarocks/share/lua/5.3/?.lua;/root/.luarocks/share/lua/5.3/?/init.lua;/root/torch/install/share/lua/5.3/?.lua;/root/torch/install/share/lua/5.3/?/init.lua;/root/torch/install/lib/lua/5.3/?.lua;/root/torch/install/lib/lua/5.3/?/init.lua;./?.lua;./?/init.lua'
os.environ['LUA_CPATH'] ='/root/.luarocks/lib/lua/5.3/?.so;/root/torch/install/lib/lua/5.3/?.so;/root/torch/install/lib/lua/5.3/loadall.so;./?.so'
os.environ['PATH'] += ':/root/torch/install/bin'

if 'LD_LIBRARY_PATH' not in os.environ.keys():
os.environ['LD_LIBRARY_PATH'] = ''
else:
os.environ['LD_LIBRARY_PATH'] += ':'
os.environ['LD_LIBRARY_PATH'] +='/root/torch/install/lib'

if 'DYLD_LIBRARY_PATH' not in os.environ.keys():
os.environ['DYLD_LIBRARY_PATH'] = ''
else:
os.environ['DYLD_LIBRARY_PATH'] += ':'
os.environ['DYLD_LIBRARY_PATH'] +='/root/torch/install/lib'

if 'LUA_CPATH' not in os.environ.keys():
os.environ['LUA_CPATH'] = ''
else:
os.environ['LUA_CPATH'] += ';'
os.environ['LUA_CPATH'] += '/root/torch/install/lib/?.so'

$luarocks install tds

and then your command

@Binathi it works thanks (y), how do i run the testing phrase with the model ?