Repository navigation
Open
Description
from transformers import BertTokenizer, BertModel
tokenizer = BertTokenizer.from_pretrained("MODEL_NAME")
model = BertModel.from_pretrained("MODEL_NAME")
我将模型下载到了本地,MiniRBT-h256-pt文件夹下有三个文件 config.json pytorch_model.bin vocab.txt
我将MODEL_NAME替换成本地模型路径:XXXXX/MiniRBT-h256-pt,
config能够正常加载
但是加载model时候报错
Some weights of the model checkpoint at XXXXX/MiniRBT-h256-pt were not used when initializing BertModel: ['cls.predictions.bias', 'cls.predictions.decoder.bias', 'cls.predictions.transform.dense.bias', 'cls.predictions.decoder.weight', 'cls.predictions.transform.LayerNorm.bias', 'cls.predictions.transform.dense.weight', 'cls.predictions.transform.LayerNorm.weight']
- This IS expected if you are initializing BertModel from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
- This IS NOT expected if you are initializing BertModel from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
Some weights of BertModel were not initialized from the model checkpoint at XXXXXX/MiniRBT-h256-pt and are newly initialized: ['bert.pooler.dense.bias', 'bert.pooler.dense.weight']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
根据错误提示的是,模型结构和权重不一致,导致的,请问这个问题是我下载文件有错误?还是哪里的错误
Metadata
Metadata
Assignees
Labels
No labels
Activity
CodeXiaoLingYun commentedon Oct 11, 2023
我查阅了下文档,这个好像是警告,并不是错误?
CodeXiaoLingYun commentedon Oct 11, 2023
我查阅了下文档,这个好像是警告,并不是错误?
futz12 commentedon Sep 8, 2024
我验证了,他这个模型没带pooler的权重了,导致最终pooler_output的数据是随机的