Megvii-BaseDetection / Megvii-BaseDetection/YOLOX

IndexError: tuple index out of range

Open
#890 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.6k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

zhaolimin@gpuv100:~/YOLOX$ python tools/demo.py image -n yolox-s -c /home/zhaolimin/YOLOX/path/to/your/yolox_s.pth --path assets/dog.jpg --conf 0.25 --nms 0.45 --tsize 640 --save_result --device gpu
2021-11-09 10:53:17.385 | INFO | main:main:250 - Args: Namespace(camid=0, ckpt='/home/zhaolimin/YOLOX/path/to/your/yolox_s.pth', conf=0.25, demo='image', device='gpu', exp_file=None, experiment_name='yolox_s', fp16=False, fuse=False, legacy=False, name='yolox-s', nms=0.45, path='assets/dog.jpg', save_result=True, trt=False, tsize=640)
/home/zhaolimin/anaconda3/envs/YOLOX/lib/python3.7/site-packages/torch/nn/functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at /pytorch/c10/core/TensorImpl.h:1156.)
return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode)
2021-11-09 10:53:21.485 | INFO | main:main:260 - Model Summary: Params: 8.97M, Gflops: 26.87
2021-11-09 10:53:27.553 | INFO | main:main:271 - loading checkpoint
2021-11-09 10:53:27.728 | INFO | main:main:275 - loaded checkpoint done.
2021-11-09 10:53:27.787 | INFO | main:inference:160 - Infer time: 0.0422s
Traceback (most recent call last):
File "tools/demo.py", line 306, in
main(exp, args)
File "tools/demo.py", line 297, in main
image_demo(predictor, vis_folder, args.path, current_time, args.save_result)
File "tools/demo.py", line 190, in image_demo
result_image = predictor.visual(outputs[0], img_info, predictor.confthre)
File "tools/demo.py", line 178, in visual
vis_res = vis(img, bboxes, scores, cls, cls_conf, self.cls_names)
File "/home/zhaolimin/YOLOX/yolox/utils/visualize.py", line 25, in vis
text = '{}:{:.1f}%'.format(class_names[cls_id], score * 100)
IndexError: tuple index out of range

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the image demo with the command in the report, then start at tools/demo.py and yolox/utils/visualize.py line 25, where the traceback occurs. Inspect the model output and class-name configuration involved in the visualization. Done means the demo completes and displays or saves the detection image without IndexError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
computer-vision, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.