运行出错,关于BertConfig
chenslcool opened this issue · 6 comments
chenslcool commented
按照readme中的python、torch版本都配置了
但是运行出错:loading weights file pretrained_bert_models/chinese_roberta_wwm_large_ext/pytorch_model.bin的时候
AttributeError: 'BertConfig' object has no attribute 'lstm_embedding_size'
hemingkx commented
可以看一下readme这一块~
model parameters
在./experiments/clue/config.json中设置了Bert/Roberta模型的基本参数,而在./pretrained_bert_models下的两个预训练文件夹中,config.json除了设置Bert/Roberta的基本参数外,还设置了'X'模型(如LSTM)参数,可根据需要进行更改。
hemingkx commented
现在还有问题吗?如果你用的预训练模型没有lstm部分把这部分参数删去或者去找对应的model config即可~
…On Tue, Dec 7, 2021 at 9:21 AM chenshanliang ***@***.***> wrote:
不好意思,我没有很理解,config文件中是存在"lstm_embedding_size": 1024的,具体应该如何修改呢?
麻烦了
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQG4K3UGZGS5YANLDTS75F3UPVOQZANCNFSM5JN3WLGA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
chenslcool commented
已经解决了,谢谢!
ZZQ908268856 commented
请问怎么解决的?
1357810la commented
按照readme中的python、torch版本都配置了 但是运行出错:loading weights file pretrained_bert_models/chinese_roberta_wwm_large_ext/pytorch_model.bin的时候 AttributeError: 'BertConfig' object has no attribute 'lstm_embedding_size'
你好,能问下怎么解决的吗
stay-leave commented
我的解决方法:直接在预训练模型的config.json中加上对应的参数和值,比如这个是768,然后还有加上lstm的dropout,我设的0.5