-
Notifications
You must be signed in to change notification settings - Fork 7
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
RuntimeError: selected index k out of range #1
Comments
Hi! Can you provide the exact command you used? And a description of the dataset and its structure on the disk? When I run the command below, I don't get any errors. python examples/zero_shot.py --datasets insects2=data/examples/val/
The zero-shot classnames are the folder names. If you provide more details, I'm happy to help. |
May I ask how many classes you use and how many images you use? |
My co-author suggests that if you have less than five classes, top5 accuracy is meaningless. In this case, you can remove all references to top5 accuracy (lines 193, 210, 214) and only calculate top1 accuracy. Line 208 should be changed: acc1, acc5 = accuracy(logits, targets, topk=(1, 5)) to acc1 = accuracy(logits, targets, topk=(1,))[0] If you have zero classes, then this script will not work at all. |
Add butterflies field guides and bird datasets
hi, playin with example zero_shot.py and got error RuntimeError: selected index k out of range (line 174).
what can be metter of this? how to avoid error?
The text was updated successfully, but these errors were encountered: