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

RuntimeError: cannot perform reduction function max on tensor with no elements because the operation does not have an identity #34

Open
Syazaniwhd opened this issue Aug 18, 2022 · 0 comments

Comments

@Syazaniwhd
Copy link

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

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