nlpyang/PreSumm

use test_text mode, but load_state_dict wrong!

Closed this issue · 1 comments

hi, when i use test_text mode, but the load_state_dict happened wrong.
Traceback (most recent call last): File "/Users/zhangmc/software_kg/PreSumm-dev/src/train.py", line 140, in <module> test_text_abs(args) File "/Users/zhangmc/software_kg/PreSumm-dev/src/train_abstractive.py", line 324, in test_text_abs model = AbsSummarizer(args, device, checkpoint) File "/Users/zhangmc/software_kg/PreSumm-dev/src/models/model_builder.py", line 217, in __init__ self.load_state_dict(checkpoint['model'], strict=True) File "/Users/zhangmc/software_kg/venv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 830, in load_state_dict self.__class__.__name__, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for AbsSummarizer: Missing key(s) in state_dict: "bert.model.embeddings.position_ids".
can you give me help, thank you!

@MrZhangmc Did you manage to solve this issue? I also have the same issue.