salesforce / factCC

Resources for the "Evaluating the Factual Consistency of Abstractive Text Summarization" paper
https://arxiv.org/abs/1910.12840
BSD 3-Clause "New" or "Revised" License
275 stars 31 forks source link

When running pretrained model FastCCX on annotated_data, it has debug #9

Closed gaozhiguang closed 3 years ago

gaozhiguang commented 3 years ago

when i use the pretrained model FastCCX provided by the link to evalute the annotated data, i have met the debug like this:

03/24/2021 20:54:10 - INFO - main - Loading model from checkpoint. =========== <class 'model.BertPointer'> ============== 03/24/2021 20:54:15 - INFO - pytorch_transformers.modeling_utils - loading weights file https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased-pytorch_model.bin from cache at /home/zggao/.cache/torch/pytorch_transformers/aa1ef1aede4482d0dbcd4d52baad8ae300e60902e88fcb0bebdec09afd232066.36ca03ab34a1a5d5fa7bc3d03d55c4fa650fed07220e2eeebc06ce58d0e9a157 Traceback (most recent call last): File "/home/zggao/document-summarization/abs-sum-fact-problem/factCC-master/modeling//run.py", line 520, in main() File "/home/zggao/document-summarization/abs-sum-fact-problem/factCC-master/modeling//run.py", line 460, in main model = model_class.from_pretrained(args.model_name_or_path, from_tf=bool('.ckpt' in args.model_name_or_path), config=config) File "/home/zggao/anaconda3/envs/testtransformers/lib/python3.6/site-packages/pytorch_transformers/modeling_utils.py", line 536, in from_pretrained model = cls(config, *model_args, **model_kwargs) File "/home/zggao/document-summarization/abs-sum-fact-problem/factCC-master/modeling/model.py", line 52, in init self.apply(self.init_weights) File "/home/zggao/anaconda3/envs/testtransformers/lib/python3.6/site-packages/torch/nn/modules/module.py", line 440, in apply module.apply(fn) File "/home/zggao/anaconda3/envs/testtransformers/lib/python3.6/site-packages/torch/nn/modules/module.py", line 440, in apply module.apply(fn) File "/home/zggao/anaconda3/envs/testtransformers/lib/python3.6/site-packages/torch/nn/modules/module.py", line 440, in apply module.apply(fn) File "/home/zggao/anaconda3/envs/testtransformers/lib/python3.6/site-packages/torch/nn/modules/module.py", line 441, in apply fn(self) TypeError: init_weights() takes 1 positional argument but 2 were given

how can i fix this?

gaozhiguang commented 3 years ago

I delete the code "self.apply(self.init_weights)" in model.py line 52 , and i can evalute the factccx now.