快速加载预训练模型

时间:2020-08-03 14:41:25

标签: nlp pytorch bert-language-model huggingface-transformers fast-ai

这是我第一次进行二进制文本分类,我正在使用快速库来与CamemBert一起工作。经过微调后,我尝试进行训练,但遇到此错误:

boxplot(mpg ~ cyl, data=mtcars,
    notch=FALSE,
    varwidth=TRUE,
    col="red",
    main="Car Mileage Data",
    xlab="Number of Cylinders",
    ylab="Miles Per Gallon")

奇怪的是,我尝试进行多标签分类,并且效果很好。

我该如何解决?

这是经过微调后获得的config.json文件:

Error(s) in loading state_dict for CamembertForSequenceClassification:
    size mismatch for classifier.out_proj.weight: copying a param with shape torch.Size([10, 768]) from checkpoint, the shape in current model is torch.Size([2, 768]).
    size mismatch for classifier.out_proj.bias: copying a param with shape torch.Size([10]) from checkpoint, the shape in current model is torch.Size([2]).

0 个答案:

没有答案