Event Server hook test error "Unknown layer type" and other configuration?
Posted: Fri Apr 11, 2025 3:32 pm
----------Debian 12, zoneMinder 1.36.35. ES 6.1.29 and hook---------
Hi everyone, I installed zoneminder 1.36 and 1.38 last year, it costed me one month to install zm and get email alerts sent to my email inbox. but I did not dare to install the Event Server with Machine leaning Hook it's way too overwhelming for me! But now I am retired. I decided to make a try.
I searched internet, could not find any step by step tutorials online. I went ahead and followed the instruction here https://zmeventnotification.readthedocs ... stall.html and add the --break option in the official install.sh (viewtopic.php?t=33644), installed the zoneminder Event Server with hook.
First, I tested the Event Server manually using: sudo -u www-data /usr/bin/zmeventnotification.pl --debug, there is no intimidating red errors.
Second, I tried to test hook (https://zmeventnotification.readthedocs ... hooks.html): sudo -u www-data /var/lib/zmeventnotification/bin/zm_detect.py --config /etc/zm/objectconfig.ini --eventid 95 --monitorid 1 --debug, (95 is the event number which is already recorded by zoneminder MoTect).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The errors in the output:
04/11/25 22:35:57 zmesdetect_m1[3200] ERR detect_sequence.py:710 [Error running model: OpenCV(4.8.0) /root/opencv/modules/dnn/src/darknet/darknet_io.cpp:902: error: (-212:Parsing error) Unknown layer type: in function 'ReadDarknetFromCfgStream'
]
04/11/25 22:35:57 zmesdetect_m1[3200] DBG2 detect_sequence.py:711 [Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/pyzm/ml/detect_sequence.py", line 707, in detect_stream
_b,_l,_c,_m = m.detect(image=frame)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pyzm/ml/object.py", line 78, in detect
b,l,c,_model_names = self.model.detect(image)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pyzm/ml/yolo.py", line 173, in detect
self.load_model()
File "/usr/local/lib/python3.11/dist-packages/pyzm/ml/yolo.py", line 104, in load_model
self.net = cv2.dnn.readNet(self.options.get('object_weights'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cv2.error: OpenCV(4.8.0) /root/opencv/modules/dnn/src/darknet/darknet_io.cpp:902: error: (-212:Parsing error) Unknown layer type: in function 'ReadDarknetFromCfgStream'
]
~~~~~~~~~~~~~~~~~~~~~~~
Error log on zoneminder UI:
ERR,"Error running model: OpenCV(4.8.0) /root/opencv/modules/dnn/src/darknet/darknet_io.cpp:902: error: (-212:Parsing error) Unknown layer type: in function 'ReadDarknetFromCfgStream'",detect_sequence.py,710
ERR,"Error loading KNN model: [Errno 2] No such file or directory: '/var/lib/zmeventnotification/known_faces/faces.dat'",face_dlib.py,110
ERR,"No known faces found to train, encoding file not created",face_train_dlib.py,137
~~~~~~~~~~~~~~~~~~~~~~~~~
I asked Gemini, he helped me compiled opencv 4.8 (as suggested at the end of install.sh) and reinstalled it, but after two days struggling, the error is still the there.
Can anyone help me resolve the issue?
My understanding of hook is let hook do object recognition: zoneminder MoDect takes pictures of the event, hook check out the zm pictures, if it's a person or animal or car, it trigger zoneminder to record and email me an alert. This way, a flying moth will not be reported to my email inbox. Please correct me if I am wrong.
Are there any detailed instructions about configurations to realize my purpose?
Any advice would be very appreciated!
Hi everyone, I installed zoneminder 1.36 and 1.38 last year, it costed me one month to install zm and get email alerts sent to my email inbox. but I did not dare to install the Event Server with Machine leaning Hook it's way too overwhelming for me! But now I am retired. I decided to make a try.
I searched internet, could not find any step by step tutorials online. I went ahead and followed the instruction here https://zmeventnotification.readthedocs ... stall.html and add the --break option in the official install.sh (viewtopic.php?t=33644), installed the zoneminder Event Server with hook.
First, I tested the Event Server manually using: sudo -u www-data /usr/bin/zmeventnotification.pl --debug, there is no intimidating red errors.
Second, I tried to test hook (https://zmeventnotification.readthedocs ... hooks.html): sudo -u www-data /var/lib/zmeventnotification/bin/zm_detect.py --config /etc/zm/objectconfig.ini --eventid 95 --monitorid 1 --debug, (95 is the event number which is already recorded by zoneminder MoTect).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The errors in the output:
04/11/25 22:35:57 zmesdetect_m1[3200] ERR detect_sequence.py:710 [Error running model: OpenCV(4.8.0) /root/opencv/modules/dnn/src/darknet/darknet_io.cpp:902: error: (-212:Parsing error) Unknown layer type: in function 'ReadDarknetFromCfgStream'
]
04/11/25 22:35:57 zmesdetect_m1[3200] DBG2 detect_sequence.py:711 [Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/pyzm/ml/detect_sequence.py", line 707, in detect_stream
_b,_l,_c,_m = m.detect(image=frame)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pyzm/ml/object.py", line 78, in detect
b,l,c,_model_names = self.model.detect(image)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pyzm/ml/yolo.py", line 173, in detect
self.load_model()
File "/usr/local/lib/python3.11/dist-packages/pyzm/ml/yolo.py", line 104, in load_model
self.net = cv2.dnn.readNet(self.options.get('object_weights'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cv2.error: OpenCV(4.8.0) /root/opencv/modules/dnn/src/darknet/darknet_io.cpp:902: error: (-212:Parsing error) Unknown layer type: in function 'ReadDarknetFromCfgStream'
]
~~~~~~~~~~~~~~~~~~~~~~~
Error log on zoneminder UI:
ERR,"Error running model: OpenCV(4.8.0) /root/opencv/modules/dnn/src/darknet/darknet_io.cpp:902: error: (-212:Parsing error) Unknown layer type: in function 'ReadDarknetFromCfgStream'",detect_sequence.py,710
ERR,"Error loading KNN model: [Errno 2] No such file or directory: '/var/lib/zmeventnotification/known_faces/faces.dat'",face_dlib.py,110
ERR,"No known faces found to train, encoding file not created",face_train_dlib.py,137
~~~~~~~~~~~~~~~~~~~~~~~~~
I asked Gemini, he helped me compiled opencv 4.8 (as suggested at the end of install.sh) and reinstalled it, but after two days struggling, the error is still the there.
Can anyone help me resolve the issue?
My understanding of hook is let hook do object recognition: zoneminder MoDect takes pictures of the event, hook check out the zm pictures, if it's a person or animal or car, it trigger zoneminder to record and email me an alert. This way, a flying moth will not be reported to my email inbox. Please correct me if I am wrong.
Are there any detailed instructions about configurations to realize my purpose?
Any advice would be very appreciated!