Fusing layers...
Model Summary: 232 layers, 7459581 parameters, 0 gradients
1/1: rtsp://root:[email protected]/cam0_2... success (320x240 at 0.00 FPS).
0: 480x640 3 persons, 1 tvs, Done. (7.801s)
Traceback (most recent call last):
File "detect.py", line 172, in
detect()
File "detect.py", line 118, in detect
cv2.imshow(p, im0)
SystemError:
terminate called without an active exception
Can you tell me how to resolve this problem?
@leeyunhome I'd recommend you raise this issue on the opencv repo as the error generates there.
https://github.com/opencv/opencv
@leeyunhome I'd recommend you raise this issue on the opencv repo as the error generates there.
https://github.com/opencv/opencv
Hello, @glenn-jocher
I asked the following questions:
https://github.com/opencv/opencv/issues/18821
Thank you.
@leeyunhome great! I think this section of code was working in previous cv2 versions, the cv2.imshow() command is one of the most basic, it simply displays an image.
I have the same problem.
The code is not working after I update my mac(now is macOS Big Sur). It work well before I update the system.
The same question occur when I run the detect with webcam.
`python detect.py --source 0 --weights yolov5s.pt --conf 0.4 311 17:46:15 3.66 2.38G
Namespace(agnostic_nms=False, augment=False, classes=None, conf_thres=0.4, device='', exist_ok=False, img_size=640, iou_thres=0.45, name='exp', project='runs/detect', save_conf=False, save_txt=False, source='0', update=False, view_img=False, weights=['yolov5s.pt'])
Using torch 1.6.0 CPU
Fusing layers...
Model Summary: 232 layers, 7459581 parameters, 0 gradients
1/1: 0... success (1280x720 at 12.00 FPS).
0: 384x640 Done. (0.304s)
Traceback (most recent call last):
File "detect.py", line 172, in
detect()
File "detect.py", line 118, in detect
cv2.imshow(p, im0)
SystemError:
@LU4E ah, yes perhaps this is the cause. I updated my MacOS 11.0.1 Big Sur the other day and now I also can't use the cv2.imshow() function.
cv2.imshow('p', im0)
Add the ' 'above the p
I have the same problem.
The code is not working after I update my mac(now is macOS Big Sur). It work well before I update the system.
The same question occur when I run the detect with webcam.`python detect.py --source 0 --weights yolov5s.pt --conf 0.4 311 17:46:15 3.66 2.38G
Namespace(agnostic_nms=False, augment=False, classes=None, conf_thres=0.4, device='', exist_ok=False, img_size=640, iou_thres=0.45, name='exp', project='runs/detect', save_conf=False, save_txt=False, source='0', update=False, view_img=False, weights=['yolov5s.pt'])
Using torch 1.6.0 CPUFusing layers...
Model Summary: 232 layers, 7459581 parameters, 0 gradients
1/1: 0... success (1280x720 at 12.00 FPS).0: 384x640 Done. (0.304s)
Traceback (most recent call last):
File "detect.py", line 172, in
detect()
File "detect.py", line 118, in detect
cv2.imshow(p, im0)
SystemError: returned NULL without setting an error`
Thank you.
cv2.imshow('p', im0)
Add the ' 'above the p
Thank you. 👍
cv2.imshow('p', im0)
Add the ' 'above the p
Hello,
I solved it thanks to you.
Can I ask why you are doing this?
Thank you.
@Kaiwen6 ah thanks for spotting this!
This issue should now be resolved by the following PR. The problem was p was a posixpath rather than a str.
Most helpful comment
cv2.imshow('p', im0)
Add the ' 'above the p