Hello, sorry to bother you,I met an issue when I tried to train the GAR model, as follows:
Traceback (most recent call last):
File "train_generator.py", line 245, in val_dataloader
Traceback (most recent call last):
return self.get_dataloader("val", batch_size=self.hparams.eval_batch_size, num_workers=4)
File "/home/zhangxy/QA/GAR-master/gar/train_generator.py", line 245, in val_dataloader
File "train_generator.py", line 225, in get_dataloader
dataset = SummarizationDataset(self.tokenizer, type_path=type_path, **self.dataset_kwargs)
File "../gar/utils_gen.py", line 177, in init
return self.get_dataloader("val", batch_size=self.hparams.eval_batch_size, num_workers=4)
self.source = pickle.load(open(os.path.join(data_dir, type_path + f".source.processed{suffix}"), 'rb'))
File "/home/zhangxy/QA/GAR-master/gar/train_generator.py", line 225, in get_dataloader
ModuleNotFoundError: No module named 'transformers.tokenization_utils_base'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "train_generator.py", line 308, in
dataset = SummarizationDataset(self.tokenizer, type_path=type_path, **self.dataset_kwargs)
File "../gar/utils_gen.py", line 177, in init
main(args)
File "train_generator.py", line 285, in main
self.source = pickle.load(open(os.path.join(data_dir, type_path + f".source.processed{suffix}"), 'rb'))
ModuleNotFoundError: No module named 'transformers.tokenization_utils_base'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/zhangxy/QA/GAR-master/gar/train_generator.py", line 308, in
trainer = generic_train(model, args, logger, resume_cp_file=cp_file, )
File "../gar/lightning_base.py", line 220, in generic_train
main(args)
trainer.fit(model)
File "/home/zhangxy/QA/GAR-master/gar/train_generator.py", line 285, in main
File "/home/zhangxy/anaconda3/envs/torch15DPR/lib/python3.6/site-packages/pytorch_lightning/trainer/states.py", line 48, in wrapped_fn
result = fn(self, *args, **kwargs)
File "/home/zhangxy/anaconda3/envs/torch15DPR/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 1058, in fit
trainer = generic_train(model, args, logger, resume_cp_file=cp_file, )
File "../gar/lightning_base.py", line 220, in generic_train
trainer.fit(model)
File "/home/zhangxy/anaconda3/envs/torch15DPR/lib/python3.6/site-packages/pytorch_lightning/trainer/states.py", line 48, in wrapped_fn
result = fn(self, *args, **kwargs)
File "/home/zhangxy/anaconda3/envs/torch15DPR/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 1046, in fit
results = self.accelerator_backend.spawn_ddp_children(model)
File "/home/zhangxy/anaconda3/envs/torch15DPR/lib/python3.6/site-packages/pytorch_lightning/accelerators/ddp_backend.py", line 123, in spawn_ddp_children
results = self.ddp_train(local_rank, mp_queue=None, model=model, is_master=True)
File "/home/zhangxy/anaconda3/envs/torch15DPR/lib/python3.6/site-packages/pytorch_lightning/accelerators/ddp_backend.py", line 224, in ddp_train
results = self.trainer.run_pretrain_routine(model)
File "/home/zhangxy/anaconda3/envs/torch15DPR/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 1224, in run_pretrain_routine
self.accelerator_backend.train(model)
File "/home/zhangxy/anaconda3/envs/torch15DPR/lib/python3.6/site-packages/pytorch_lightning/accelerators/ddp_backend.py", line 57, in train
self.ddp_train(process_idx=self.task_idx, mp_queue=None, model=model)
File "/home/zhangxy/anaconda3/envs/torch15DPR/lib/python3.6/site-packages/pytorch_lightning/accelerators/ddp_backend.py", line 224, in ddp_train
results = self.trainer.run_pretrain_routine(model)
File "/home/zhangxy/anaconda3/envs/torch15DPR/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 1224, in run_pretrain_routine
self._run_sanity_check(ref_model, model)
File "/home/zhangxy/anaconda3/envs/torch15DPR/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 1249, in _run_sanity_check
self._run_sanity_check(ref_model, model)
File "/home/zhangxy/anaconda3/envs/torch15DPR/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 1249, in _run_sanity_check
self.reset_val_dataloader(ref_model)
File "/home/zhangxy/anaconda3/envs/torch15DPR/lib/python3.6/site-packages/pytorch_lightning/trainer/data_loading.py", line 337, in reset_val_dataloader
self.num_val_batches, self.val_dataloaders = self._reset_eval_dataloader(model, 'val')
File "/home/zhangxy/anaconda3/envs/torch15DPR/lib/python3.6/site-packages/pytorch_lightning/trainer/data_loading.py", line 266, in _reset_eval_dataloader
dataloaders = self.request_dataloader(getattr(model, f'{mode}_dataloader'))
File "/home/zhangxy/anaconda3/envs/torch15DPR/lib/python3.6/site-packages/pytorch_lightning/trainer/data_loading.py", line 360, in request_dataloader
self.reset_val_dataloader(ref_model)
File "/home/zhangxy/anaconda3/envs/torch15DPR/lib/python3.6/site-packages/pytorch_lightning/trainer/data_loading.py", line 337, in reset_val_dataloader
dataloader = dataloader_fx()
File "train_generator.py", line 248, in val_dataloader
self.num_val_batches, self.val_dataloaders = self._reset_eval_dataloader(model, 'val')
File "/home/zhangxy/anaconda3/envs/torch15DPR/lib/python3.6/site-packages/pytorch_lightning/trainer/data_loading.py", line 266, in _reset_eval_dataloader
return self.get_dataloader("train", batch_size=self.hparams.eval_batch_size, num_workers=4)
File "train_generator.py", line 225, in get_dataloader
dataloaders = self.request_dataloader(getattr(model, f'{mode}_dataloader'))
File "/home/zhangxy/anaconda3/envs/torch15DPR/lib/python3.6/site-packages/pytorch_lightning/trainer/data_loading.py", line 360, in request_dataloader
dataset = SummarizationDataset(self.tokenizer, type_path=type_path, **self.dataset_kwargs)
File "../gar/utils_gen.py", line 177, in init
self.source = pickle.load(open(os.path.join(data_dir, type_path + f".source.processed{suffix}"), 'rb'))
ModuleNotFoundError: No module named 'transformers.tokenization_utils_base'
dataloader = dataloader_fx()
File "/home/zhangxy/QA/GAR-master/gar/train_generator.py", line 248, in val_dataloader
return self.get_dataloader("train", batch_size=self.hparams.eval_batch_size, num_workers=4)
File "/home/zhangxy/QA/GAR-master/gar/train_generator.py", line 225, in get_dataloader
dataset = SummarizationDataset(self.tokenizer, type_path=type_path, **self.dataset_kwargs)
File "../gar/utils_gen.py", line 177, in init
self.source = pickle.load(open(os.path.join(data_dir, type_path + f".source.processed{suffix}"), 'rb'))
ModuleNotFoundError: No module named 'transformers.tokenization_utils_base'
I installed transformers==2.11.0 and tokenizers==0.7.0
I run the project with command: GEN_TARGET='answer' python train_generator.py --remark generator_train_nq_A --train_batch_size 128 --eval_batch_size 256 --ckpt_metric val-ROUGE-1
So, how can I solve it ?
Thanks in advance !!