I am running the algorithm on a Mac OS and this is the error I get when I run the detect.py file
run code:
python detect.py --weights yolov5s.pt --source data/images/carpark1.jpg
error output:
Namespace(agnostic_nms=False, augment=False, classes=None, conf_thres=0.4, device='', img_size=1024, iou_thres=0.5, output='inference/output', save_txt=False, source='data/images/carpark1.jpg', update=False, view_img=False, weights=['yolov5s.pt'])
Using CPU
Fusing layers...
Model Summary: 140 layers, 7.45958e+06 parameters, 0 gradients
image 1/1 /Users/syazaniwahid/Documents/UROPS/YOLO/YOLOV5_RBB/rotation-yolov5/data/images/carpark1.jpg: Traceback (most recent call last):
File "detect.py", line 174, in
detect()
File "detect.py", line 79, in detect
pred = rotate_non_max_suppression(pred, opt.conf_thres, opt.iou_thres, classes=opt.classes, agnostic=True)
File "/Users/syazaniwahid/Documents/UROPS/YOLO/YOLOV5_RBB/rotation-yolov5/utils/general.py", line 845, in rotate_non_max_suppression
conf, j = x[:, 5:5 + nc].max(1, keepdim=True)
RuntimeError: cannot perform reduction function max on tensor with no elements because the operation does not have an identity
I am running the algorithm on a Mac OS and this is the error I get when I run the detect.py file
run code: python detect.py --weights yolov5s.pt --source data/images/carpark1.jpg
error output: Namespace(agnostic_nms=False, augment=False, classes=None, conf_thres=0.4, device='', img_size=1024, iou_thres=0.5, output='inference/output', save_txt=False, source='data/images/carpark1.jpg', update=False, view_img=False, weights=['yolov5s.pt']) Using CPU
Fusing layers... Model Summary: 140 layers, 7.45958e+06 parameters, 0 gradients image 1/1 /Users/syazaniwahid/Documents/UROPS/YOLO/YOLOV5_RBB/rotation-yolov5/data/images/carpark1.jpg: Traceback (most recent call last): File "detect.py", line 174, in
detect()
File "detect.py", line 79, in detect
pred = rotate_non_max_suppression(pred, opt.conf_thres, opt.iou_thres, classes=opt.classes, agnostic=True)
File "/Users/syazaniwahid/Documents/UROPS/YOLO/YOLOV5_RBB/rotation-yolov5/utils/general.py", line 845, in rotate_non_max_suppression
conf, j = x[:, 5:5 + nc].max(1, keepdim=True)
RuntimeError: cannot perform reduction function max on tensor with no elements because the operation does not have an identity