Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

size mismatch for ranker.embeddings.token_type_embeddings.weight #4

Open
GoddessLuBoYan opened this issue Jul 15, 2020 · 1 comment

Comments

@GoddessLuBoYan
Copy link

trackback(堆栈信息):

  File "code/KBQA_Runner.py", line 819, in <module>
    main()
  File "code/KBQA_Runner.py", line 581, in main
    policy.load_state_dict(model_dic, strict=False)
  File "/home/lujincheng/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 839, in load_state_dict
    self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for Policy:
        size mismatch for ranker.embeddings.token_type_embeddings.weight: copying a param with shape torch.Size([5, 768]) from checkpoint, the shape in current model is torch.Size([3, 768]).

environment(环境):

python3.6, torch==1.3.0

use model/data:
CQ, all from your google drives

@GoddessLuBoYan
Copy link
Author

oh I get it, change "type_vocab_size" from 3 to 5(in /config/bert_config.json)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant