I am using the pretrained En-De model with the following command,
python translate.py -model wmt_ende_sp/model/averaged-10-epoch.pt -src data/test.en -tgt data/test.de -verbose
and I got the following error,
Traceback (most recent call last):
File "D:\anaconda\envs\opennmt\Scripts\onmt_translate-script.py", line 33, in <module>
sys.exit(load_entry_point('OpenNMT-py', 'console_scripts', 'onmt_translate')())
File "f:\desktop\opennmt-py\opennmt-py-master\onmt\bin\translate.py", line 60, in main
translate(opt)
File "f:\desktop\opennmt-py\opennmt-py-master\onmt\bin\translate.py", line 23, in translate
translator = build_translator(opt, logger=logger,
File "f:\desktop\opennmt-py\opennmt-py-master\onmt\translate\translator.py", line 31, in build_translator
vocabs, model, model_opt = load_test_model(opt)
File "f:\desktop\opennmt-py\opennmt-py-master\onmt\model_builder.py", line 90, in load_test_model
checkpoint = torch.load(model_path,
File "D:\anaconda\envs\opennmt\lib\site-packages\torch\serialization.py", line 712, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File "D:\anaconda\envs\opennmt\lib\site-packages\torch\serialization.py", line 1049, in _load
result = unpickler.load()
File "D:\anaconda\envs\opennmt\lib\site-packages\torch\serialization.py", line 1042, in find_class
return super().find_class(mod_name, name)
ModuleNotFoundError: No module named 'onmt.inputters.text_dataset'
In addition, I want to know how to use the SentencePiece model. I won’t use it.
I hope you can help me.