Thanks! That worked!eresonance wrote: ↑Sun Feb 19, 2023 6:35 pm I have python3.11 and OpenCV 4.7.0 and I see the same issue. I think there's a problem detecting the opencv version.
Open up the yolo.py script:Go to line 95:Code: Select all
sudo vim /usr/local/lib/python3.11/site-packages/pyzm/ml/yolo.py
We want that to look like:Code: Select all
(maj, minor, patch) = cv2.__version__.split('.') min_ver = int(maj + minor) patch = int(patch) if patch.isdigit() else 0 if min_ver >= 45 and patch >=4: # see https://github.com/opencv/opencv/issues/20923 # we need to modify Yolo code not to expect a nested structure g.logger.Debug(1, 'You are using OpenCV >= 4.5.4, making sure we fix getUnconnectedOutLayers() API') self.is_get_unconnected_api_list = True
That will handle the case where your minor version is > 5 but your patch is < 4.Code: Select all
(maj, minor, patch) = cv2.__version__.split('.') min_ver = int(maj + minor + patch) if min_ver >= 454: # see https://github.com/opencv/opencv/issues/20923 # we need to modify Yolo code not to expect a nested structure g.logger.Debug(1, 'You are using OpenCV >= 4.5.4, making sure we fix getUnconnectedOutLayers() API') self.is_get_unconnected_api_list = True
My ZM was 1.37.40
Python was 3.10
I just installed all ML packages, including the OpenCV 4.7.0
My error wasn't even as verbose as Pedulla:
May 4 17:55:09 videoserver zm_detect.py[242542]: ERR [zmesdetect_m1] [Error running model: invalid index to scalar variable.]
What do I need to turn on for line numbers ?
@eresonance, you should push this patch into GitHub