I am getting an error when running the translate script on a trained model.
I run the following command:
python OpenNMT-py/translate.py -model opennmt_models/brnn_acc_40.74_ppl_37.57_e3.pt -src gu_codebase/data/src-val.txt -output opennmt_models/pred.txt -replace_unk -verbose
and receive the error message:
> xxx$ python OpenNMT-py/translate.py -model opennmt_models/brnn_acc_40.74_ppl_37.57_e3.pt -src gu_codebase/data/src-val.txt -output opennmt_models/pred.txt -replace_unk -verbose
Could not find setup.py for directory /Users/jusjosgra/mlpractical (tried all parent directories)
Could not find setup.py for directory /Users/jusjosgra/mlpractical (tried all parent directories)
Traceback (most recent call last):
File "OpenNMT-py/translate.py", line 33, in <module>
main(opt)
File "OpenNMT-py/translate.py", line 19, in main
translator = make_translator(opt, report_score=True, logger=logger)
File "/Users/jusjosgra/uni/dissertation/OpenNMT-py/onmt/translate/Translator.py", line 27, in make_translator
onmt.ModelConstructor.load_test_model(opt, dummy_opt.__dict__)
File "xxx/OpenNMT-py/onmt/ModelConstructor.py", line 119, in load_test_model
map_location=lambda storage, loc: storage)
File "xxx/anaconda/lib/python3.5/site-packages/torch/serialization.py", line 303, in load
return _load(f, map_location, pickle_module)
File "xxx/anaconda/lib/python3.5/site-packages/torch/serialization.py", line 469, in _load
result = unpickler.load()
ImportError: No module named 'onmt.utils'