Problem when installing new version after using luarocks install on an older version


(Vincent Vandeghinste) #1

I have made a new dir on my gpu machine and cloned version 0.9 from github

[vincent@knox /home/local/opennmt/version0.9]$ git clone https://github.com/OpenNMT/OpenNMT.git
Cloning into ‘OpenNMT’…
remote: Counting objects: 18184, done.
remote: Compressing objects: 100% (51/51), done.
remote: Total 18184 (delta 26), reused 50 (delta 18), pack-reused 18105
Receiving objects: 100% (18184/18184), 23.29 MiB | 11.71 MiB/s, done.
Resolving deltas: 100% (11276/11276), done.

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

Did I forget something or is this a bug?


OpenNMT v0.9 release
(Guillaume Klein) #2

I think this is related to:


(Vincent Vandeghinste) #3

Does this imply that I cannot have two different versions of OpenNMT running on the same machine?


(Guillaume Klein) #4

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.


(Vincent Vandeghinste) #5

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


(Etienne Monneret) #6

I think your only problem is that you have to launch your command being in the main ONMT folder itself.

cd /home/local/opennmt/version0.9/OpenNMT/
th train.lua -data [PathToYourData]/enhu-train.t7 -save_model [PathToYourData]/enhu -gpuid 1

:wink:


(Guillaume Klein) #7

Simply don’t install OpenNMT with luarocks. This is source of errors.

Type:

luarocks remove opennmt

and re-try.


(Vincent Vandeghinste) #8

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?


(Guillaume Klein) #9

You can call luarocks from anywhere but you will still need to use OpenNMT from the OpenNMT directory.