ymcui / Chinese-BERT-wwm

Pre-Training with Whole Word Masking for Chinese BERT(中文BERT-wwm系列模型)
https://ieeexplore.ieee.org/document/9599397
Apache License 2.0
9.69k stars 1.39k forks source link

transformer2.2.2 加载参数失败 #144

Closed RoacherM closed 4 years ago

RoacherM commented 4 years ago

直接加载会报错 OSError: Model name '/Users/wonbyron/bert/chinese_roberta_wwm_large_ext_pytorch/' was not found in model name list (bert-base-uncased, bert-large-uncased, bert-base-cased, bert-large-cased, bert-base-multilingual-uncased, bert-base-multilingual-cased, bert-base-chinese, bert-base-german-cased, bert-large-uncased-whole-word-masking, bert-large-cased-whole-word-masking, bert-large-uncased-whole-word-masking-finetuned-squad, bert-large-cased-whole-word-masking-finetuned-squad, bert-base-cased-finetuned-mrpc, bert-base-german-dbmdz-cased, bert-base-german-dbmdz-uncased). We assumed '/Users/wonbyron/bert/chinese_roberta_wwm_large_ext_pytorch/config.json' was a path or url to a configuration file named config.json or a directory containing such a file but couldn't find any such file at this path or url. 经检查,应该将config文件改成bert.config才行

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ymcui commented 4 years ago

没太明白你的意思,是指config文件内容有问题还是加载的时候config文件名有问题?

RoacherM commented 4 years ago

transformer2.2.2 默认加载的是config.json而不是bert_config.json,提供的原始参数文件应该采用前者命名而不是后者,否则回报错

ymcui commented 4 years ago

了解。本目录并不会一直适配新的transformer库,所以请按需修改文件名以适配新版本。