yolov5 分割标记训练,训练很顺利但之后把权重加入到detect.py时就出现了以下错误,根本得不到结果,有没有哪位大佬能帮帮我,真的十分感谢!
"D:\python huangjing\anoconda\envs\yolo5\python.exe" "D:\python huangjing\yolov5\yolov5-master\detect.py"
detect: weights=D:\python huangjing\yolov5\yolov5-master\exp14\weights\best.pt, source=data\images, data=data\coco128.yaml, imgsz=[640, 640], conf_thres=0.25, 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=runs\detect, name=exp, exist_ok=False, line_thickness=3, hide_labels=False, hide_conf=False, half=False, dnn=False, vid_stride=1
YOLOv5 2023-3-10 Python-3.8.0 torch-1.11.0+cu113 CUDA:0 (NVIDIA GeForce GTX 1650, 4096MiB)
Fusing layers...
Model summary: 165 layers, 7401119 parameters, 0 gradients, 25.7 GFLOPs
Traceback (most recent call last):
File "D:\python huangjing\yolov5\yolov5-master\detect.py", line 261, in <module>
main(opt)
File "D:\python huangjing\yolov5\yolov5-master\detect.py", line 256, in main
run(**vars(opt))
File "D:\python huangjing\anoconda\envs\yolo5\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "D:\python huangjing\yolov5\yolov5-master\detect.py", line 160, in run
s += f"{n} {names[int(c)]}{'s' * (n > 1)}, " # add to string
KeyError: 2
进程已结束,退出代码1