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

’IndexError: list index out of range’ when running val.py with yolov9-c-converted.pt #524

Open
kurokei3333 opened this issue Jul 1, 2024 · 0 comments

Comments

@kurokei3333
Copy link

I am encountering an IndexError: list index out of range when running the val.py script with the yolov9-c-converted.pt weights file. The error occurs during the COCO-JSON dictionary saving process. Below are the details of the error and the steps to reproduce it.

##Environment:

  • Python version: 3.8.12
  • Torch version: 1.11.0a0+b6df043
  • CUDA version: 0 (NVIDIA RTX A6000, 48677MiB)
  • YOLOv5 commit: 1e33dbb

##Command
python3 val.py --img 640 --batch 8 --conf 0.001 --iou 0.7 --device 0 --data /workspace/yolov9/data/coco.yaml --weights /workspace/yolov9color/weights/yolov9-c-converted.pt

##Error log
val: data=/workspace/yolov9/data/coco.yaml, weights=['/workspace/yolov9color/weights/yolov9-c-converted.pt'], batch_size=8, imgsz=640, conf_thres=0.001, iou_thres=0.7, max_det=300, task=val, device=0, workers=8, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=True, project=runs/val, name=exp, exist_ok=False, half=False, dnn=False, min_items=0
YOLOv5 🚀 1e33dbb Python-3.8.12 torch-1.11.0a0+b6df043 CUDA:0 (NVIDIA RTX A6000, 48677MiB)

Fusing layers...
gelan-c summary: 467 layers, 25472640 parameters, 64944 gradients, 102.8 GFLOPs
val: Scanning /workspace/yolov9/datasets/coco/val2017.cache... 4952 images, 48 backgrounds, 0 corrupt: 100%|██████████| 5000/5000 00:00
Class Images Instances P R mAP50 mAP50-95: 0%| | 0/625 00:00
Traceback (most recent call last):
File "val.py", line 389, in
main(opt)
File "val.py", line 362, in main
run(**vars(opt))
File "/opt/conda/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 28, in decorate_context
return func(*args, **kwargs)
File "val.py", line 244, in run
save_one_json(predn, jdict, path, class_map) # append to COCO-JSON dictionary
File "val.py", line 46, in save_one_json
'category_id': class_map[int(p[5])],
IndexError: list index out of range

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

1 participant