问题报错
initializing bert tokenizer...
creating huggingface model...
Some weights of the model checkpoint at bert-base-uncased were not used when initializing BertForSequenceClassification: ['cls.predictions.bias', 'cls.predictions.transform.LayerNorm.bias', 'cls.seq_relationship.bias', 'cls.predictions.transform.dense.bias', 'cls.seq_relationship.weight', 'cls.predictions.transform.LayerNorm.weight', 'cls.predictions.transform.dense.weight', 'cls.predictions.decoder.weight']
This IS expected if you are initializing BertForSequenceClassification 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 BertForSequenceClassification from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
Some weights of BertForSequenceClassification were not initialized from the model checkpoint at bert-base-uncased and are newly initialized: ['classifier.bias', 'classifier.weight']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
creating lightseq model...
Traceback (most recent call last):
File "D:\leetcode算法\ls_bert.py", line 112, in
main()
File "D:\leetcode算法\ls_bert.py", line 82, in main
ls_model = LightseqBertClassification("lightseq_bert_base_uncased.hdf5", hf_model)
File "D:\leetcode算法\ls_bert.py", line 56, in init
self.ls_bert = lsi.Bert(ls_weight_path, 128)
AttributeError: module 'lightseq.inference' has no attribute 'Bert'
问题报错 initializing bert tokenizer... creating huggingface model... Some weights of the model checkpoint at bert-base-uncased were not used when initializing BertForSequenceClassification: ['cls.predictions.bias', 'cls.predictions.transform.LayerNorm.bias', 'cls.seq_relationship.bias', 'cls.predictions.transform.dense.bias', 'cls.seq_relationship.weight', 'cls.predictions.transform.LayerNorm.weight', 'cls.predictions.transform.dense.weight', 'cls.predictions.decoder.weight']
Process finished with exit code 1
问题复现: 直接运行example中的ls_bert.py报错 从 clone下来的文件夹和在另外独立的文件夹都有这个错误