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

Error while running inference_ram_plus.py #169

Open
Pranavk02 opened this issue Mar 20, 2024 · 2 comments
Open

Error while running inference_ram_plus.py #169

Pranavk02 opened this issue Mar 20, 2024 · 2 comments

Comments

@Pranavk02
Copy link

Pranavk02 commented Mar 20, 2024

Hi, @xinyu1205
After installing the package in different venv, I ran inference_ram_plus.py file and faced this error:

Traceback (most recent call last): File "/Users/pranavkumar/Desktop/py-image-tag/main.py", line 43, in <module> model = ram_plus(pretrained=args.pretrained, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/pranavkumar/anaconda3/envs/imgageTag/lib/python3.11/site-packages/ram/models/ram_plus.py", line 398, in ram_plus model, msg = load_checkpoint_swinlarge(model, pretrained, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/pranavkumar/anaconda3/envs/imgageTag/lib/python3.11/site-packages/ram/models/utils.py", line 258, in load_checkpoint_swinlarge raise RuntimeError('checkpoint url or path is invalid') RuntimeError: checkpoint url or path is invalid

@Pranavk02
Copy link
Author

Hi @xinyu1205

@adbmdp
Copy link

adbmdp commented Apr 13, 2024

The error message "RuntimeError: checkpoint url or path is invalid" indicates that the code is unable to locate or load the pre-trained model weights (checkpoint) you're trying to use.

Did you download the pre-trained model weights here? https://github.com/xinyu1205/recognize-anything#toolbox-checkpoints

I ran inference_ram_plus.py file

How?
Should be like this:

python inference_ram_plus.py  --image images/demo/demo1.jpg \
--pretrained pretrained/ram_plus_swin_large_14m.pth

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