Skip to content
This repository has been archived by the owner on Jun 10, 2021. It is now read-only.

Error loading pretrained model #52

Closed
pmadhyastha opened this issue Jan 5, 2017 · 2 comments
Closed

Error loading pretrained model #52

pmadhyastha opened this issue Jan 5, 2017 · 2 comments

Comments

@pmadhyastha
Copy link

When loading the pre-trained model I get this error:

th translate.lua -model pretrained_models/onmt_baseline_wmt15-all.de-en_epoch13_8.98.t7 -src data/test.de                                                   
Loading 'pretrained_models/onmt_baseline_wmt15-all.de-en_epoch13_8.98.t7'...    
/root/torch/install/bin/luajit: /root/torch/install/share/lua/5.1/torch/File.lua:343: unknown Torch class <torch.CudaTensor>
stack traceback:
    [C]: in function 'error'
    /root/torch/install/share/lua/5.1/torch/File.lua:343: in function 'readObject'
    /root/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    /root/torch/install/share/lua/5.1/nn/Module.lua:184: in function 'read'
    /root/torch/install/share/lua/5.1/torch/File.lua:351: in function 'readObject'
    /root/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    /root/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    /root/torch/install/share/lua/5.1/torch/File.lua:353: in function 'readObject'
    /root/torch/install/share/lua/5.1/torch/File.lua:368: in function 'readObject'
    /root/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    /root/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    ...
    /root/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    /root/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    /root/torch/install/share/lua/5.1/torch/File.lua:409: in function 'load'
    ./onmt/translate/Translator.lua:29: in function '__init'
    /root/torch/install/share/lua/5.1/torch/init.lua:91: in function 'new'
    translate.lua:65: in function 'main'
    translate.lua:193: in main chunk
    [C]: in function 'dofile'
    /root/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
    [C]: at 0x00406670

There is a simple way of remedying this problem (a dirty hack): by loading cunn and cudnn in onmt/translate/Translator.lua.

@guillaumekln
Copy link
Collaborator

This model is a GPU model so you need to specify on which GPU you want to load it with the -gpuid option.

@srush
Copy link
Contributor

srush commented Jan 5, 2017

I will change the documentation to include this by default. It seems like it would be hard to catch this error, as we don't know about it until we fail.

@srush srush closed this as completed Jan 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants