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

Weibo Datase處理 #28

Open
elaine35002 opened this issue Dec 4, 2024 · 1 comment
Open

Weibo Datase處理 #28

elaine35002 opened this issue Dec 4, 2024 · 1 comment

Comments

@elaine35002
Copy link

作者您好,我想使用ZEN做embedding並提取相應的詞向量,因此執行了以下程式碼:

 python3 run_token_level_classification.py --data_dir data/weibo --bert_model models --task_name msra --do_train --do_ev
al --train_batch_size 32 --eval_batch_size 32 --learning_rate 2e-5 --num_train_epochs 3

但出現如下報錯:

raceback (most recent call last):
  File "run_token_level_classification.py", line 438, in <module>
    main()
  File "run_token_level_classification.py", line 425, in main
    model = ZenForTokenClassification.from_pretrained(args.bert_model,
  File "/home/code-server/SANER/ZEN/modeling.py", line 838, in from_pretrained
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for ZenForTokenClassification:
        size mismatch for classifier.weight: copying a param with shape torch.Size([10, 768]) from checkpoint, the shape in current model is torch.Size([20, 768]).
        size mismatch for classifier.bias: copying a param with shape torch.Size([10]) from checkpoint, the shape in current model is torch.Size([20]).

請問可以怎麼解決呢?謝謝 我用的模型是下載的預訓練NER模型
image

@GuiminChen
Copy link
Collaborator

GuiminChen commented Dec 4, 2024 via email

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

2 participants