ModuleNotFoundError: No module named 'onmt.IO'

pytorch

(liweikang) #1

when run the train.py
ModuleNotFoundError: No module named ‘onmt.IO’ has happened, how to deal with it?

The traceback is as follow:
Traceback (most recent call last):
File “D:/PyCharm/WorkSpace/OpenNMT-py-master/train.py”, line 502, in
main()
File “D:/PyCharm/WorkSpace/OpenNMT-py-master/train.py”, line 476, in main
first_dataset = next(lazily_load_dataset(“train”))
File “D:/PyCharm/WorkSpace/OpenNMT-py-master/train.py”, line 332, in lazily_load_dataset
yield lazy_dataset_loader(pt, corpus_type)
File “D:/PyCharm/WorkSpace/OpenNMT-py-master/train.py”, line 319, in lazy_dataset_loader
dataset = torch.load(pt_file)
File “C:\Users\LWK\Anaconda3\lib\site-packages\torch\serialization.py”, line 303, in load
return _load(f, map_location, pickle_module)
File “C:\Users\LWK\Anaconda3\lib\site-packages\torch\serialization.py”, line 469, in _load
result = unpickler.load()
ModuleNotFoundError: No module named ‘onmt.IO