When I now try to use train.lua as before with version 0.8, I get an error:
[vincent@knox /home/wiske/tmmt/enhu/nmt]$ th /home/local/opennmt/version0.9/OpenNMT/train.lua -data enhu-train.t7 -save_model enhu -gpuid 1
/home/pricie/vincent/torch/install/bin/luajit: /home/local/opennmt/version0.9/OpenNMT/train.lua:24: attempt to index field ‘DynamicDataRepository’ (a nil value)
stack traceback:
/home/local/opennmt/version0.9/OpenNMT/train.lua:24: in main chunk
[C]: in function ‘dofile’
…cent/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x004064f0
You can but you need to remove the version that was globally installed with luarocks. You can simply maintain 2 separate directories and cd into the one you want to use.
Thanks.
I took your suggestion, which seemed to work fine
[vincent@knox /home/local/opennmt/version0.9/OpenNMT]$ luarocks make rocks/opennmt-scm-1.rockspec
Updating manifest for /home/pricie/vincent/torch/install/lib/luarocks/rocks
opennmt scm-1 is now built and installed in /home/pricie/vincent/torch/install/ (license: MIT)
But when I try to train, I still get
[vincent@knox /home/wiske/tmmt/enhu/nmt]$ th /home/local/opennmt/version0.9/OpenNMT/train.lua -data enhu-train.t7 -save_model enhu -gpuid 1
/home/pricie/vincent/torch/install/bin/luajit: …t/torch/install/share/lua/5.1/onmt/data/Preprocessor.lua:198: attempt to call field ‘getOpts’ (a nil value)
stack traceback:
…t/torch/install/share/lua/5.1/onmt/data/Preprocessor.lua:198: in function ‘declareOpts’
…nstall/share/lua/5.1/onmt/data/DynamicDataRepository.lua:7: in function ‘declareOpts’
/home/local/opennmt/version0.9/OpenNMT/train.lua:24: in main chunk
[C]: in function ‘dofile’
…cent/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x004064f0
Thanks, that did indeed the trick. So if I want to be able to call it from anywhere, I should remove the globally installed version using luarocks remove opennmt ? But from which path would I have to launch this luarocks command?