THUNLP-MT / THUMT

An open-source neural machine translation toolkit developed by Tsinghua Natural Language Processing Group
BSD 3-Clause "New" or "Revised" License
695 stars 197 forks source link

TypeError: Can't instantiate abstract class MapDataset with abstract methods _inputs, set_inputs #104

Open zhuchenxi opened 2 years ago

zhuchenxi commented 2 years ago

When I run: thumt-trainer \ --input corpus.tc.32k.zh.shuf corpus.tc.32k.en.shuf \ --vocabulary vocab.32k.zh.txt vocab.32k.en.txt \ --model transformer \ --validation newsdev2017.tc.32k.zh \ --references newsdev2017.tc.en \ --parameters=batch_size=4096,device_list=[0,1,2,3],update_cycle=2 \ --hparam_set base

I have got this error message: Traceback (most recent call last): File "/gruntdata7/mike.zcx/ENV/lib64/python3.6/site-packages/torch/multiprocessing/spawn.py", line 59, in _wrap fn(i, args) File "/gruntdata9/mike.zcx/translate/THUMT/thumt/bin/trainer.py", line 496, in process_fn main(local_args) File "/gruntdata9/mike.zcx/translate/THUMT/thumt/bin/trainer.py", line 406, in main dataset = data.MTPipeline.get_train_dataset(params.input, params) File "/gruntdata9/mike.zcx/translate/THUMT/thumt/data/pipeline.py", line 108, in get_train_dataset dataset = dataset.map(map_obj) File "/gruntdata9/mike.zcx/translate/THUMT/thumt/data/dataset.py", line 82, in map return MapDataset(self, fn) File "/usr/lib64/python3.6/typing.py", line 1231, in new return _generic_new(cls.next_in_mro, cls, args, **kwds) File "/usr/lib64/python3.6/typing.py", line 1186, in _generic_new return base_cls.new(cls) TypeError: Can't instantiate abstract class MapDataset with abstract methods _inputs, set_inputs

what can I do to handle this problem? Thanks very much.

zhuchenxi commented 2 years ago

My Python Version: 3.6.8 My Torch Version: 1.8.0