video inference와 image inference 수행 중 다음과 같은 오류가 발생했습니다.
--weights /mydrive/ultra_workdir/simult/weights/best.pt --conf 0.3 \
--project=/content/data/output --name=run_video --exist-ok --line-thickness 2
실행 중 오류 코드:
detect: weights=['/mydrive/ultra_workdir/simult/weights/best.pt'], source=/content/simult/simul_1.mp4, imgsz=[640, 640], conf_thres=0.3, iou_thres=0.45, max_det=1000, device=, view_img=False, save_txt=False, save_conf=False, save_crop=False, nosave=False, classes=None, agnostic_nms=False, augment=False, visualize=False, update=False, project=/content/data/output, name=run_video, exist_ok=True, line_thickness=2, hide_labels=False, hide_conf=False, half=False, dnn=False YOLOv3 🚀 v9.6.0-3-gb870de5 torch 1.10.0+cu111 CUDA:0 (Tesla P100-PCIE-16GB, 16281MiB) Fusing layers... Model Summary: 261 layers, 61497430 parameters, 0 gradients, 154.7 GFLOPs Traceback (most recent call last): File "detect.py", line 244, in <module> main(opt) File "detect.py", line 239, in main run(**vars(opt)) File "/usr/local/lib/python3.7/dist-packages/torch/autograd/grad_mode.py", line 28, in decorate_context return func(*args, **kwargs) File "detect.py", line 149, in run s += f"{n} {names[int(c)]}{'s' * (n > 1)}, " # add to string KeyError: 0
image inference 코드:
# image 파일 inference
!cd /content/yolov3;python detect.py --source /content/simult/images/train/13.png \
--weights /mydrive/ultra_workdir/simult/weights/best.pt --conf 0.3 \
--project=/content/data/output --name=run_image --exist-ok --line-thickness 2
실행 중 오류 코드:
detect: weights=['/mydrive/ultra_workdir/simult/weights/best.pt'], source=/content/simult/images/train/13.png, imgsz=[640, 640], conf_thres=0.3, iou_thres=0.45, max_det=1000, device=, view_img=False, save_txt=False, save_conf=False, save_crop=False, nosave=False, classes=None, agnostic_nms=False, augment=False, visualize=False, update=False, project=/content/data/output, name=run_image, exist_ok=True, line_thickness=2, hide_labels=False, hide_conf=False, half=False, dnn=False YOLOv3 🚀 v9.6.0-3-gb870de5 torch 1.10.0+cu111 CUDA:0 (Tesla P100-PCIE-16GB, 16281MiB) Fusing layers... Model Summary: 261 layers, 61497430 parameters, 0 gradients, 154.7 GFLOPs Traceback (most recent call last): File "detect.py", line 244, in <module> main(opt) File "detect.py", line 239, in main run(**vars(opt)) File "/usr/local/lib/python3.7/dist-packages/torch/autograd/grad_mode.py", line 28, in decorate_context return func(*args, **kwargs) File "detect.py", line 149, in run s += f"{n} {names[int(c)]}{'s' * (n > 1)}, " # add to string KeyError: 0
이러한 오류를 어떻게 해결해야 하는지 알고 싶습니다.