OFASys icon indicating copy to clipboard operation
OFASys copied to clipboard

Unable to load the checkpoint

Open ilovecv opened this issue 2 years ago • 1 comments

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

ilovecv avatar Jan 06 '23 17:01 ilovecv

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.

jinze1994 avatar Jan 07 '23 08:01 jinze1994