OpenNMT Forum

Torch : installation issues

opennmt-lua
(Kishor Kp) #1

Hi,
Presently I was installing OpenNMT translation server. The first step for this is to install Torch.
Step 1 and Step 2 are successful. While there are issue in Step 3 and Step 4. Please assist me in resolving the issue.

Step 1:
kishor@kishor-VirtualBox:~/torch$ git clone https://github.com/torch/distro.git ~/torch --recursive
Cloning into ‘/home/kishor/torch’…
remote: Enumerating objects: 1601, done.
remote: Total 1601 (delta 0), reused 0 (delta 0), pack-reused 1601
Receiving objects: 100% (1601/1601), 345.52 KiB | 486.00 KiB/s, done.
Resolving deltas: 100% (927/927), done.
Submodule ‘exe/env’ (https://github.com/torch/env.git) registered for path ‘exe/env’
Submodule ‘exe/luajit-rocks’ (https://github.com/torch/luajit-rocks.git) registered for path ‘exe/luajit-rocks’
Submodule ‘exe/qtlua’ (https://github.com/torch/qtlua.git) registered for path ‘exe/qtlua’
Submodule ‘exe/trepl’ (https://github.com/torch/trepl.git) registered for path ‘exe/trepl’
Submodule ‘extra/argcheck’ (https://github.com/torch/argcheck.git) registered for path ‘extra/argcheck’
Submodule ‘extra/cudnn’ (https://github.com/soumith/cudnn.torch.git) registered for path ‘extra/cudnn’
Submodule ‘extra/cunn’ (https://github.com/torch/cunn.git) registered for path ‘extra/cunn’
Submodule ‘extra/cutorch’ (https://github.com/torch/cutorch.git) registered for path ‘extra/cutorch’
Submodule ‘extra/graph’ (https://github.com/torch/graph) registered for path ‘extra/graph’
Submodule ‘extra/lua-cjson’ (https://github.com/mpx/lua-cjson) registered for path ‘extra/lua-cjson’
Submodule ‘extra/luaffifb’ (https://github.com/facebook/luaffifb) registered for path ‘extra/luaffifb’
Submodule ‘extra/luafilesystem’ (https://github.com/keplerproject/luafilesystem.git) registered for path ‘extra/luafilesystem’
Submodule ‘extra/moses’ (https://github.com/Yonaba/Moses.git) registered for path ‘extra/moses’
Submodule ‘extra/nn’ (https://github.com/torch/nn.git) registered for path ‘extra/nn’
Submodule ‘extra/nngraph’ (https://github.com/torch/nngraph) registered for path ‘extra/nngraph’
Submodule ‘extra/nnx’ (https://github.com/clementfarabet/lua---nnx.git) registered for path ‘extra/nnx’
Submodule ‘extra/penlight’ (https://github.com/stevedonovan/Penlight.git) registered for path ‘extra/penlight’
Submodule ‘extra/threads’ (https://github.com/torch/threads-ffi.git) registered for path ‘extra/threads’
Submodule ‘pkg/cwrap’ (https://github.com/torch/cwrap.git) registered for path ‘pkg/cwrap’
Submodule ‘pkg/dok’ (https://github.com/torch/dok.git) registered for path ‘pkg/dok’
Submodule ‘pkg/gnuplot’ (https://github.com/torch/gnuplot.git) registered for path ‘pkg/gnuplot’
Submodule ‘pkg/image’ (https://github.com/torch/image.git) registered for path ‘pkg/image’
Submodule ‘pkg/optim’ (https://github.com/torch/optim.git) registered for path ‘pkg/optim’
Submodule ‘pkg/paths’ (https://github.com/torch/paths.git) registered for path ‘pkg/paths’
Submodule ‘pkg/qttorch’ (https://github.com/torch/qttorch.git) registered for path ‘pkg/qttorch’
Submodule ‘pkg/sundown’ (https://github.com/torch/sundown-ffi.git) registered for path ‘pkg/sundown’
Submodule ‘pkg/sys’ (https://github.com/torch/sys.git) registered for path ‘pkg/sys’
Submodule ‘pkg/torch’ (https://github.com/torch/torch7.git) registered for path ‘pkg/torch’
Submodule ‘pkg/xlua’ (https://github.com/torch/xlua.git) registered for path ‘pkg/xlua’
Cloning into ‘/home/kishor/torch/exe/env’…
remote: Enumerating objects: 26, done.
remote: Total 26 (delta 0), reused 0 (delta 0), pack-reused 26
Cloning into ‘/home/kishor/torch/exe/luajit-rocks’…
remote: Enumerating objects: 2737, done.
remote: Total 2737 (delta 0), reused 0 (delta 0), pack-reused 2737
Receiving objects: 100% (2737/2737), 7.53 MiB | 2.12 MiB/s, done.
Resolving deltas: 100% (1759/1759), done.
Cloning into ‘/home/kishor/torch/exe/qtlua’…
remote: Enumerating objects: 710, done.
remote: Total 710 (delta 0), reused 0 (delta 0), pack-reused 710
Receiving objects: 100% (710/710), 597.10 KiB | 661.00 KiB/s, done.
Resolving deltas: 100% (354/354), done.
Cloning into ‘/home/kishor/torch/exe/trepl’…
remote: Enumerating objects: 514, done.
remote: Total 514 (delta 0), reused 0 (delta 0), pack-reused 514
Receiving objects: 100% (514/514), 115.87 KiB | 248.00 KiB/s, done.
Resolving deltas: 100% (294/294), done.
Cloning into ‘/home/kishor/torch/extra/argcheck’…
remote: Enumerating objects: 538, done.
remote: Total 538 (delta 0), reused 0 (delta 0), pack-reused 538
Receiving objects: 100% (538/538), 646.22 KiB | 663.00 KiB/s, done.
Resolving deltas: 100% (291/291), done.
Cloning into ‘/home/kishor/torch/extra/cudnn’…
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 2074 (delta 0), reused 0 (delta 0), pack-reused 2073
Receiving objects: 100% (2074/2074), 803.27 KiB | 779.00 KiB/s, done.
Resolving deltas: 100% (1350/1350), done.
Cloning into ‘/home/kishor/torch/extra/cunn’…
remote: Enumerating objects: 3995, done.
remote: Total 3995 (delta 0), reused 0 (delta 0), pack-reused 3995
Receiving objects: 100% (3995/3995), 1.47 MiB | 1.04 MiB/s, done.
Resolving deltas: 100% (2581/2581), done.
Cloning into ‘/home/kishor/torch/extra/cutorch’…
remote: Enumerating objects: 5701, done.
remote: Total 5701 (delta 0), reused 0 (delta 0), pack-reused 5701
Receiving objects: 100% (5701/5701), 2.10 MiB | 1.29 MiB/s, done.
Resolving deltas: 100% (3465/3465), done.
Cloning into ‘/home/kishor/torch/extra/graph’…
remote: Enumerating objects: 225, done.
remote: Total 225 (delta 0), reused 0 (delta 0), pack-reused 225
Receiving objects: 100% (225/225), 56.70 KiB | 199.00 KiB/s, done.
Resolving deltas: 100% (112/112), done.
Cloning into ‘/home/kishor/torch/extra/lua-cjson’…
remote: Enumerating objects: 1040, done.
remote: Total 1040 (delta 0), reused 0 (delta 0), pack-reused 1040
Receiving objects: 100% (1040/1040), 269.29 KiB | 363.00 KiB/s, done.
Resolving deltas: 100% (661/661), done.
Cloning into ‘/home/kishor/torch/extra/luaffifb’…
remote: Enumerating objects: 963, done.
remote: Total 963 (delta 0), reused 0 (delta 0), pack-reused 963
Receiving objects: 100% (963/963), 452.84 KiB | 448.00 KiB/s, done.
Resolving deltas: 100% (684/684), done.
Cloning into ‘/home/kishor/torch/extra/luafilesystem’…
remote: Enumerating objects: 1643, done.
remote: Total 1643 (delta 0), reused 0 (delta 0), pack-reused 1643
Receiving objects: 100% (1643/1643), 327.00 KiB | 429.00 KiB/s, done.
Resolving deltas: 100% (746/746), done.
Cloning into ‘/home/kishor/torch/extra/moses’…
remote: Enumerating objects: 13, done.
remote: Counting objects: 100% (13/13), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 1972 (delta 5), reused 12 (delta 5), pack-reused 1959
Receiving objects: 100% (1972/1972), 1.42 MiB | 1.02 MiB/s, done.
Resolving deltas: 100% (1146/1146), done.
Cloning into ‘/home/kishor/torch/extra/nn’…
remote: Enumerating objects: 7662, done.
remote: Total 7662 (delta 0), reused 0 (delta 0), pack-reused 7662
Receiving objects: 100% (7662/7662), 3.72 MiB | 1.68 MiB/s, done.
Resolving deltas: 100% (4898/4898), done.
Cloning into ‘/home/kishor/torch/extra/nngraph’…
remote: Enumerating objects: 664, done.
remote: Total 664 (delta 0), reused 0 (delta 0), pack-reused 664
Receiving objects: 100% (664/664), 1.87 MiB | 1.21 MiB/s, done.
Resolving deltas: 100% (356/356), done.
Cloning into ‘/home/kishor/torch/extra/nnx’…
remote: Enumerating objects: 2483, done.
remote: Total 2483 (delta 0), reused 0 (delta 0), pack-reused 2483
Receiving objects: 100% (2483/2483), 1.27 MiB | 926.00 KiB/s, done.
Resolving deltas: 100% (1420/1420), done.
Cloning into ‘/home/kishor/torch/extra/penlight’…
remote: Enumerating objects: 13, done.
remote: Counting objects: 100% (13/13), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 4645 (delta 8), reused 7 (delta 6), pack-reused 4632
Receiving objects: 100% (4645/4645), 1.74 MiB | 1.20 MiB/s, done.
Resolving deltas: 100% (2836/2836), done.
Cloning into ‘/home/kishor/torch/extra/threads’…
remote: Enumerating objects: 429, done.
remote: Total 429 (delta 0), reused 0 (delta 0), pack-reused 429
Receiving objects: 100% (429/429), 108.21 KiB | 213.00 KiB/s, done.
Resolving deltas: 100% (228/228), done.
Cloning into ‘/home/kishor/torch/pkg/cwrap’…
remote: Enumerating objects: 109, done.
remote: Total 109 (delta 0), reused 0 (delta 0), pack-reused 109
Receiving objects: 100% (109/109), 38.05 KiB | 159.00 KiB/s, done.
Resolving deltas: 100% (43/43), done.
Cloning into ‘/home/kishor/torch/pkg/dok’…
remote: Enumerating objects: 186, done.
remote: Total 186 (delta 0), reused 0 (delta 0), pack-reused 186
Receiving objects: 100% (186/186), 133.83 KiB | 249.00 KiB/s, done.
Resolving deltas: 100% (59/59), done.
Cloning into ‘/home/kishor/torch/pkg/gnuplot’…
remote: Enumerating objects: 308, done.
remote: Total 308 (delta 0), reused 0 (delta 0), pack-reused 308
Receiving objects: 100% (308/308), 240.89 KiB | 324.00 KiB/s, done.
Resolving deltas: 100% (167/167), done.
Cloning into ‘/home/kishor/torch/pkg/image’…
remote: Enumerating objects: 1392, done.
remote: Total 1392 (delta 0), reused 0 (delta 0), pack-reused 1392
Receiving objects: 100% (1392/1392), 2.75 MiB | 1.39 MiB/s, done.
Resolving deltas: 100% (767/767), done.
Cloning into ‘/home/kishor/torch/pkg/optim’…
remote: Enumerating objects: 929, done.
remote: Total 929 (delta 0), reused 0 (delta 0), pack-reused 929
Receiving objects: 100% (929/929), 403.82 KiB | 439.00 KiB/s, done.
Resolving deltas: 100% (513/513), done.
Cloning into ‘/home/kishor/torch/pkg/paths’…
remote: Enumerating objects: 153, done.
remote: Total 153 (delta 0), reused 0 (delta 0), pack-reused 153
Receiving objects: 100% (153/153), 53.42 KiB | 214.00 KiB/s, done.
Resolving deltas: 100% (62/62), done.
Cloning into ‘/home/kishor/torch/pkg/qttorch’…
remote: Enumerating objects: 60, done.
remote: Total 60 (delta 0), reused 0 (delta 0), pack-reused 60
Cloning into ‘/home/kishor/torch/pkg/sundown’…
remote: Enumerating objects: 238, done.
remote: Total 238 (delta 0), reused 0 (delta 0), pack-reused 238
Receiving objects: 100% (238/238), 140.57 KiB | 281.00 KiB/s, done.
Resolving deltas: 100% (80/80), done.
Cloning into ‘/home/kishor/torch/pkg/sys’…
remote: Enumerating objects: 220, done.
remote: Total 220 (delta 0), reused 0 (delta 0), pack-reused 220
Receiving objects: 100% (220/220), 36.83 KiB | 165.00 KiB/s, done.
Resolving deltas: 100% (115/115), done.
Cloning into ‘/home/kishor/torch/pkg/torch’…
remote: Enumerating objects: 6722, done.
remote: Total 6722 (delta 0), reused 0 (delta 0), pack-reused 6722
Receiving objects: 100% (6722/6722), 2.56 MiB | 1.41 MiB/s, done.
Resolving deltas: 100% (4214/4214), done.
Cloning into ‘/home/kishor/torch/pkg/xlua’…
remote: Enumerating objects: 282, done.
remote: Total 282 (delta 0), reused 0 (delta 0), pack-reused 282
Receiving objects: 100% (282/282), 59.22 KiB | 207.00 KiB/s, done.
Resolving deltas: 100% (156/156), done.
Submodule path ‘exe/env’: checked out ‘d28424ac5b638686410304c60c31693849f3d1dd’
Submodule path ‘exe/luajit-rocks’: checked out ‘411f4b9d9c4be176d4aab965ebfce50911583e14’
Submodule path ‘exe/qtlua’: checked out ‘8b80419ca2458e172b0d245999114f2b9d4ac118’
Submodule path ‘exe/trepl’: checked out ‘e5e17e3a56997123bd6c66cb8575175d3a6945bb’
Submodule path ‘extra/argcheck’: checked out ‘b3b32c060c4269c25d11cf9f983c291d9448e1ee’
Submodule path ‘extra/cudnn’: checked out ‘008c49de3982119378576fa4244e472a50fd9ebe’
Submodule path ‘extra/cunn’: checked out ‘27d79db5ac8f9fa3995ac43f876e4eb146d99913’
Submodule path ‘extra/cutorch’: checked out ‘caf84f3af0b1e9f6bd5c4129c01345f7bd72e431’
Submodule path ‘extra/graph’: checked out ‘37dac07a19eb3809b8081514bc781206241863a0’
Submodule path ‘extra/lua-cjson’: checked out ‘e8972ac754788d3ef10a57a36016d6c3e85ba20d’
Submodule path ‘extra/luaffifb’: checked out ‘610ce4dc6de318c8f0eb027f052be081349097be’
Submodule path ‘extra/luafilesystem’: checked out ‘3c4e563d9c140319e28c419f2710b51a2f6d6d24’
Submodule path ‘extra/moses’: checked out ‘ded0a9b773bb78ded2c1dd5da721bbee4a3e32c6’
Submodule path ‘extra/nn’: checked out ‘200ae7d55a3381a232256223c0694498f8f51df0’
Submodule path ‘extra/nngraph’: checked out ‘3ed3b9ba9d1adf72c1fe15291a1e50b843cf04f9’
Submodule path ‘extra/nnx’: checked out ‘1c28e231f885899a4ed68266e788306cab2ac07a’
Submodule path ‘extra/penlight’: checked out ‘6d108e6a699fbafd5dace1019d03f4b4b18231fa’
Submodule path ‘extra/threads’: checked out ‘7094a90be44ecdd5f9f0b90560473ad27f3bb07d’
Submodule path ‘pkg/cwrap’: checked out ‘dbd0a623dc4dfb4b8169d5aecc6dd9aec2f22792’
Submodule path ‘pkg/dok’: checked out ‘1b36900e1bfa6ee7f48db52c577bdeb7d9e85909’
Submodule path ‘pkg/gnuplot’: checked out ‘a75e6782bdd5a7aa3ed5c2a0a88b63a916472c66’
Submodule path ‘pkg/image’: checked out ‘5aa18819b6a7b44751f8a858bd232d1c07b67985’
Submodule path ‘pkg/optim’: checked out ‘656c42af1f996e4a5d6aae3b9aeac831ca162241’
Submodule path ‘pkg/paths’: checked out ‘4ebe222ba12589fb9d86c1d3895d7f509df77b6a’
Submodule path ‘pkg/qttorch’: checked out ‘ba5b5a143482857f80237181d5fde0a3ba20477b’
Submodule path ‘pkg/sundown’: checked out ‘4324669b1adbde92cef2dbf4550428a13a03ca6f’
Submodule path ‘pkg/sys’: checked out ‘f073f057d3fd2148866eaa0444a62ababfdf935e’
Submodule path ‘pkg/torch’: checked out ‘3e9e141ced1afd0cad451e69f90e6e53503647ca’
Submodule path ‘pkg/xlua’: checked out ‘41308fe696bf8b0892f4ad4f9857d12a87a3f75e’

Step 2:
kishor@kishor-VirtualBox:~/torch$ cd ~/torch

Step 3:
kishor@kishor-VirtualBox:~/torch$ bash install-deps
Hit:1 http://in.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Fetched 252 kB in 1s (170 kB/s)
Reading package lists… Done
Updated successfully.
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package python-software-properties is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
software-properties-common

E: Package ‘python-software-properties’ has no installation candidate

Step 4:
kishor@kishor-VirtualBox:~/torch$ ./install.sh
Prefix set to /home/kishor/torch/install
Installing Lua version: LUAJIT21
./install.sh: line 73: cmake: command not found
kishor@kishor-VirtualBox:~/torch$

Please assist me in resolving this issue.

Thank you,
Kishor.

0 Likes

(Guillaume Klein) #2

What operating system are you using?

Please note that the Torch ecosystem is no longer maintained. At this point we can only recommend to use the OpenNMT Docker image.

0 Likes

(Kishor Kp) #3

Hi ,

I am using Ubuntu-18.04 .

Regards,
Kishor.

0 Likes

(Guillaume Klein) #4

Torch installation scripts most likely do not support this system. Please use the Docker image.

0 Likes

(Kishor Kp) #5

Basically, I am trying to install OpenNMT Translation Server on Ubuntu 18.04 for creating the translation tool. As first step towards this translation server installation is to install torch.
Are there any installers available to install OpenNMT Translation Server ?

Regards,
Kishor

0 Likes

(Guillaume Klein) #6

Downgrade to Ubuntu 16 or use the OpenNMT Docker image that includes a Torch installation:

docker run --entrypoint th opennmt/opennmt tools/rest_translation_server.lua -h
0 Likes

(Kishor Kp) #7

thank you for the update.

0 Likes

(Kishor Kp) #8

Hi Guillaume,

As suggested, I am going with using OpenNMT Docker image.
I have hardware which do have NVIDIA GPU on the motherboard. But to install the nvidia-docker ,
as part of pre-installation checks the system needs to have the nvidia cuda capable GPUs.
Is it mandatory ?
Please assist me here …

Thank You,
Kishor

0 Likes

(Guillaume Klein) #9

Hi,

Did you install the NVIDIA driver? See the nvidia-docker prerequisites.

If you have issues installing nvidia-docker, you should probably seek assistance on their repository.

0 Likes

(Kishor Kp) #10

Hi,

Presently, I am in the process of installing nvidia-docker. The pre-installation check requires
CUDA capable GPU. In my organization, we do not have desktops with separate NVIDIA GPUs. All
are integrated intel HD Graphics 4600.
So I am not sure if I could go ahead with the nvidia-docker installation ?

Thank You,
Kishor.

0 Likes

(Guillaume Klein) #11

I’m confused. If you don’t have a NVIDIA GPU then simply don’t install nvidia-docker and use plain docker.

0 Likes

(Kishor Kp) #12

Hi,

Okay…this resolves my major concern.

Thank you very much.

0 Likes

(Kishor Kp) #13

Hi ,

As suggested, I installed the plain docker and also run the below command:

sudo docker run -it opennmt/opennmt:latest

The above command ran successfully with below status:
Status: Downloaded the newer image for opennmt/opennmt:latest

how do I go ahead using this as server ?
Are there any procedures or steps for using the docker image (opennmt/opennmt:latest)
in our code ?
I mean How do I go ahead using it as language translation server ?

Thank You,
kishor.

0 Likes

(Guillaume Klein) #14

A few posts above:

docker run --entrypoint th opennmt/opennmt tools/rest_translation_server.lua -h

But do you have a model to serve? How did you run the training if you are unsure how to run this command?

0 Likes

(Kishor Kp) #15

Hi,

initially I am planning to use the existing model for which the translation server (OpenNMT)
is already trained.
My Project is to build a translation server using OpenNMT:

  1. Build a translation server (OpenNMT) using any of the installation methods
  2. Build a client (in Python) which sends source text extracted from a excel sheet to the server for translation
  3. The Translated response would be stored again in the excel sheet.

Presently I am in the Step 1 (above) . I require help here to build the usable Translation server (OpenNMT).

Your Timely Support is appreciated.

Thank You,
Kishor

0 Likes

(Kishor Kp) #16

Hi,

I missed certain things above:

  1. After running the command sudo docker run -it opennmt/opennmt:latest…the output is as in the
    attached file.
    openNMT_Docker

  2. when I do ls i view the following :
    openNMT_folder_contents

I would like to use the existing trained model in OpenNMT Translation Server.

I need server_url : server_port to send a request to this server.
How do I go ahead sending a request to this server ?

I am struct here…If it would be possible to assist me here…it would be really nice.

Thank You,
Kishor.

0 Likes

(Guillaume Klein) #17

Here is the documentation for the REST server:

http://opennmt.net/OpenNMT/tools/servers/#rest

0 Likes

(Kishor Kp) #18

Hi,

I could download and run the Opennmt server on ubuntu. When I run the following the curl command :
curl -v -H “Content-Type: application/json” -X POST -d ‘[{ “src” : “Hello World” }]’ http://IP_address:7784/translator/translate

I get the following response

NOTE:
The image downloaded from docker hub has been model using 13 epoch stages.

What am I missing here ?

Thank You,
Kishor

0 Likes