yangjianxin1 / LEBERT-NER-Chinese

基于词汇信息融合的中文NER模型
159 stars 18 forks source link

size mismatch for word_embeddings.weight #6

Open AnddyWang opened 2 years ago

AnddyWang commented 2 years ago

2022-06-24 11:31:30.005 | INFO | processors.processor:get_test_data:75 - len of test data:1602 Traceback (most recent call last): File "test.py", line 476, in main(args) File "test.py", line 442, in main model = MODEL_CLASS[args.model_class].from_pretrained(args.output_path, config=config).to(args.device) File "/usr/local/lib/python3.6/dist-packages/transformers/modeling_utils.py", line 972, in from_pretrained model.class.name, "\n\t".join(error_msgs) RuntimeError: Error(s) in loading state_dict for LEBertCrfForNer: size mismatch for word_embeddings.weight: copying a param with shape torch.Size([29061, 200]) from checkpoint, the shape in current model is torch.Size([29137, 200]).

预测时,报这个异常,有大佬遇到过么

Mosquito0352 commented 2 years ago

2022-06-24 11:31:30.005 | INFO | processors.processor:get_test_data:75 - len of test data:1602 Traceback (most recent call last): File "test.py", line 476, in main(args) File "test.py", line 442, in main model = MODEL_CLASS[args.model_class].from_pretrained(args.output_path, config=config).to(args.device) File "/usr/local/lib/python3.6/dist-packages/transformers/modeling_utils.py", line 972, in from_pretrained model.class.name, "\n\t".join(error_msgs) RuntimeError: Error(s) in loading state_dict for LEBertCrfForNer: size mismatch for word_embeddings.weight: copying a param with shape torch.Size([29061, 200]) from checkpoint, the shape in current model is torch.Size([29137, 200]).

预测时,报这个异常,有大佬遇到过么

2022-06-24 11:31:30.005 | INFO | processors.processor:get_test_data:75 - len of test data:1602 Traceback (most recent call last): File "test.py", line 476, in main(args) File "test.py", line 442, in main model = MODEL_CLASS[args.model_class].from_pretrained(args.output_path, config=config).to(args.device) File "/usr/local/lib/python3.6/dist-packages/transformers/modeling_utils.py", line 972, in from_pretrained model.class.name, "\n\t".join(error_msgs) RuntimeError: Error(s) in loading state_dict for LEBertCrfForNer: size mismatch for word_embeddings.weight: copying a param with shape torch.Size([29061, 200]) from checkpoint, the shape in current model is torch.Size([29137, 200]).

预测时,报这个异常,有大佬遇到过么

可以看下预测的代码么?