Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenNMT not found - google colab #18

Open
mtyrolski opened this issue Oct 24, 2020 · 9 comments
Open

OpenNMT not found - google colab #18

mtyrolski opened this issue Oct 24, 2020 · 9 comments

Comments

@mtyrolski
Copy link

Hi, I am trying to use im2text on google colab and there is a problem with path to opennmt

OpenNMT not found. Please enter the path to OpenNMT: 	 
/content/Im2Text/opennmt
Error: opennmt not found in the specified path!

how can I fix it?

@da03
Copy link
Collaborator

da03 commented Oct 24, 2020

Is the folder there then? Can you try

! ls /content/Im2Text/opennmt

and see if it's there?

@da03
Copy link
Collaborator

da03 commented Oct 24, 2020

btw, did you install lua-torch on colab youself? I don't think colab comes with lua-torch, but maybe I'm wrong.

@mtyrolski
Copy link
Author

mtyrolski commented Oct 24, 2020

Yes @da03, I have under !ls /content/Im2Text/opennmt everything from https://github.com/OpenNMT/Im2Text/tree/master/opennmt
Also, I have installed lua-torch on colab myself. It was weird because I had to compile some sources but it seems that it is installed.

%cd /content/
!git clone https://github.com/nagadomi/distro.git torch --recursive
import os
os.chdir('./torch/')
!bash install-deps
!./install.sh
!. ./install/bin/torch-activate

and then
!/content/torch/install/bin/luarocks list

----------------

argcheck
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

class
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

cudnn
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

cunn
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

cutorch
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

cwrap
   scm-1 (installed) - /root/.luarocks/lib/luarocks/rocks
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

dok
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

env
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

gnuplot
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

graph
   scm-1 (installed) - /root/.luarocks/lib/luarocks/rocks
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

image
   1.1.alpha-0 (installed) - /content/torch/install/lib/luarocks/rocks

lua-cjson
   2.1devel-1 (installed) - /content/torch/install/lib/luarocks/rocks

luaffi
   scm-1 (installed) - /root/.luarocks/lib/luarocks/rocks
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

luafilesystem
   1.6.3-1 (installed) - /content/torch/install/lib/luarocks/rocks

moses
   2.1.0-1 (installed) - /root/.luarocks/lib/luarocks/rocks
   1.6.1-1 (installed) - /content/torch/install/lib/luarocks/rocks

nn
   scm-1 (installed) - /root/.luarocks/lib/luarocks/rocks
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

nngraph
   scm-1 (installed) - /root/.luarocks/lib/luarocks/rocks
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

nnx
   0.1-1 (installed) - /content/torch/install/lib/luarocks/rocks

opennmt
   scm-1 (installed) - /root/.luarocks/lib/luarocks/rocks

optim
   1.0.5-0 (installed) - /content/torch/install/lib/luarocks/rocks

paths
   scm-1 (installed) - /root/.luarocks/lib/luarocks/rocks
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

penlight
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

qtlua
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

qttorch
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

sundown
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

sys
   1.1-0 (installed) - /content/torch/install/lib/luarocks/rocks

tds
   scm-1 (installed) - /root/.luarocks/lib/luarocks/rocks

threads
   scm-1 (installed) - /root/.luarocks/lib/luarocks/rocks
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

torch
   scm-1 (installed) - /root/.luarocks/lib/luarocks/rocks
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

trepl
   scm-1 (installed) - /content/torch/install/lib/luarocks/rocks

xlua
   1.0-0 (installed) - /content/torch/install/lib/luarocks/rocks```

@mtyrolski
Copy link
Author

mtyrolski commented Oct 24, 2020

!ls you mentioned gives results below:

/content
Constants.lua  init.lua		  ModelSelector.lua  SeqTagger.lua  translate
data	       LanguageModel.lua  modules	     tagger	    utils
Factory.lua    Model.lua	  Seq2Seq.lua	     train

so it seems that it works

@da03
Copy link
Collaborator

da03 commented Oct 24, 2020

Hmm weird, can you directly try

require 'opennmt.init'

in th?

@da03
Copy link
Collaborator

da03 commented Oct 24, 2020

such as th -e 'require opennmt.init' and see what's the error msg.

@mtyrolski
Copy link
Author

Ok, tried !/content/torch/install/bin/th -e 'require opennmt.init' and got: attempt to call a nil value

@da03
Copy link
Collaborator

da03 commented Oct 24, 2020

Hmm it might be due to the opennmt installed in rocks, can you remove /root/.luarocks/lib/luarocks/rocks/opennmt? Like by

!rm -rf /root/.luarocks/lib/luarocks/rocks/opennmt

@mtyrolski
Copy link
Author

Yes, I tried that but unfortunately it didn't fix the problem :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants