dbiir / UER-py

Open Source Pre-training Model Framework in PyTorch & Pre-trained Model Zoo
https://github.com/dbiir/UER-py/wiki
Apache License 2.0
3k stars 526 forks source link

hugging face bert-base-chinese模型转化为uer报错 #45

Open LeoWood opened 4 years ago

LeoWood commented 4 years ago

在hugging face下载的模型:https://cdn.huggingface.co/bert-base-chinese-pytorch_model.bin ,使用scripts中convert_bert_from_huggingface_to_uer.py,报错: Traceback (most recent call last): File "convert_bert_from_huggingface_to_uer.py", line 22, in output_model["embedding.layer_norm.gamma"] = input_model["bert.embeddings.LayerNorm.weight"] KeyError: 'bert.embeddings.LayerNorm.weight'

脚本: python convert_bert_from_huggingface_to_uer.py \ --input_model_path ../models/bert-base-chinese-pytorch_model.bin \ --output_model_path ../models/google_zh_model.bin

ZhaoxinRuc commented 4 years ago

可以麻烦您上传huggingface bert-base-chinese模型的链接吗?

LeoWood commented 4 years ago

可以麻烦您上传huggingface bert-base-chinese模型的链接吗?

https://cdn.huggingface.co/bert-base-chinese-pytorch_model.bin

iseesaw commented 3 years ago

貌似还没解决呢。。。