Skip to content
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

Unable to load the checkpoint #6

Open
ilovecv opened this issue Jan 6, 2023 · 1 comment
Open

Unable to load the checkpoint #6

ilovecv opened this issue Jan 6, 2023 · 1 comment

Comments

@ilovecv
Copy link

ilovecv commented Jan 6, 2023

Hi,

When I run the following code as shown in Readme:
model = OFASys.from_pretrained('multitask_10k.pt')

I had the following error:
Screenshot 2023-01-06 at 9 46 48 AM

@jinze1994
Copy link
Collaborator

First, update the ofasys package to the latest version:

pip install -U http://ofasys.oss-cn-zhangjiakou.aliyuncs.com/pkg/ofasys-0.1.0-py3-none-any.whl

Then, try to use a remote link to initialize the model, as in the documents:

from ofasys import OFASys
model = OFASys.from_pretrained('http://ofasys.oss-cn-zhangjiakou.aliyuncs.com/model_hub/multitask_10k.pt')
model = model.cuda()  # Omit this line if you don't have a GPU

Or you can download the checkpoint first, and then load it locally:

wget http://ofasys.oss-cn-zhangjiakou.aliyuncs.com/model_hub/multitask_10k.pt
python
>> model = OFASys.from_pretrained('multitask_10k.pt')

It works fine on my computer. Hope this would help you.

If you still have this problem, do not hesitate to contact us! And please provide the complete python script and system information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants