-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pytorch版本加载模型失败 #3
Comments
请将TF的版本改为1.4试一下,正常应该没有问题的 |
您好!
您这个报错应该是版本的问题,将tensorflow的版本改为1.14试试呢,我们这边都是没有问题的。
----------------
---------- Origin message ----------
From:"桐原因" ***@***.***>
To:"valuesimplex/FinBERT" ***@***.***>
Subject:[valuesimplex/FinBERT]_pytorch版本加载模型失败_(#3)
Date:2020-10-26 16:46:25
代码:
model = BertForSequenceClassification.from_pretrained(model_name+"/bert_config.json") model.to(device)
报错:
OSError: Unable to load weights from pytorch checkpoint file. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
感谢问题解决了
…------------------ 原始邮件 ------------------
发件人: "valuesimplex/FinBERT" <[email protected]>;
发送时间: 2020年10月27日(星期二) 下午3:24
收件人: "valuesimplex/FinBERT"<[email protected]>;
抄送: "刘曙"<[email protected]>;"Author"<[email protected]>;
主题: Re: [valuesimplex/FinBERT] pytorch版本加载模型失败 (#3)
您好!
您这个报错应该是版本的问题,将tensorflow的版本改为1.14试试呢,我们这边都是没有问题的。
----------------
---------- Origin message ----------
>From:"桐原因" <[email protected]>
>To:"valuesimplex/FinBERT" <[email protected]>
>Subject:[valuesimplex/FinBERT]_pytorch版本加载模型失败_(#3)
>Date:2020-10-26 16:46:25
代码:
model = BertForSequenceClassification.from_pretrained(model_name+"/bert_config.json") model.to(device)
报错:
OSError: Unable to load weights from pytorch checkpoint file. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
老哥,我不太会怎么将该预训练模型进行情感分析,您能够教教我吗?万分感谢。 |
代码:
model = BertForSequenceClassification.from_pretrained(model_name+"/bert_config.json") model.to(device)
报错:
OSError: Unable to load weights from pytorch checkpoint file. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.
The text was updated successfully, but these errors were encountered: