Seq2Seq-Vis icon indicating copy to clipboard operation
Seq2Seq-Vis copied to clipboard

error when prepare own model

Open yuxin212 opened this issue 6 years ago • 5 comments

Hi,

When I used your modified opennmt to prepare my model, I called like this:

python extract_context.py -src s2s/src-train.txt -tgt s2s/tgt-train.txt -model s2s/demo-5.pt -batch_size 64

And I got this error:

Traceback (most recent call last): File "extract_context.py", line 356, in main() File "extract_context.py", line 335, in main onmt.ModelConstructor.load_test_model(opt, dummy_opt.dict) File "/home/cc/OpenNMT-py/onmt/ModelConstructor.py", line 119, in load_test_model map_location=lambda storage, loc: storage) File "/home/cc/miniconda2/envs/s2sv/lib/python3.6/site-packages/torch/serialization.py", line 358, in load return _load(f, map_location, pickle_module) File "/home/cc/miniconda2/envs/s2sv/lib/python3.6/site-packages/torch/serialization.py", line 542, in _load result = unpickler.load() ModuleNotFoundError: No module named 'onmt.utils'

I trained my model using OpenNMT-py without your modification.

Thank you.

yuxin212 avatar Sep 22 '18 13:09 yuxin212

I am also getting the same error

msalameh83 avatar Sep 27 '18 05:09 msalameh83

That looks like there is an incopatibility with some ONMT version and our extraction. Could you give me more information? What commit did you use to train the model?

sebastianGehrmann avatar Sep 27 '18 13:09 sebastianGehrmann

That looks like there is an incopatibility with some ONMT version and our extraction. Could you give me more information? What commit did you use to train the model?

python train.py -data data/demo -save_model demo-model -enc_layers 4 -dec_layers 4 -rnn_size 200 -epochs 2000

These are options I used.

I got ONMT from: https://github.com/OpenNMT/OpenNMT-py

I will try to use your ONMT to train and extract these days.

yuxin212 avatar Sep 27 '18 13:09 yuxin212

OpenNMT underwent a significant refactor this summer which breaks backwards compatibility in some cases. I am currently working on updating the server to work with newer versions. Until then, you can use commits around this one 3bd519070ad3b092dc081d2e72d0cd129bd085c7.

sebastianGehrmann avatar Sep 27 '18 13:09 sebastianGehrmann

OpenNMT underwent a significant refactor this summer which breaks backwards compatibility in some cases. I am currently working on updating the server to work with newer versions. Until then, you can use commits around this one 3bd519070ad3b092dc081d2e72d0cd129bd085c7.

Thank you so much!

yuxin212 avatar Sep 27 '18 13:09 yuxin212