-
Notifications
You must be signed in to change notification settings - Fork 106
Open
Description
作者您好,我想使用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]).
Metadata
Metadata
Assignees
Labels
No labels
