load albert model error
- Dominant language
- Python
- Stars
- 3.1k
- Forks
- 520
- PR merge metrics
- No merged PRs in 30d
Description
File "run_kbert_cls.py", line 261, in main
model.load_state_dict(torch.load(args.pretrained_model_path), strict=False)
File "/opt/conda/envs/phchen-k/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1044, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for Model:
size mismatch for embedding.segment_embedding.weight: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([3, 128]).
您好,
這是我載入albert-base-chinese 時發生的問題 ,使用的config.json為uer所提供之
{"emb_size": 128, "feedforward_size": 3072, "hidden_size": 768, "heads_num": 12, "layers_num": 12, "dropout": 0.0}
想請問這裡的segment_embedding 能由哪裡做修改? 很感謝妳們的付出 萬分感謝 stay safe
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.