Error zmesdetect_m1: Assertion failed) preferableBackend != DNN_BACKEND_CUDA || IS_DNN_CUDA_TARGET(preferableTarget)

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
Post Reply
bzzmid
Posts: 2
Joined: Sat Aug 17, 2024 11:10 am

Error zmesdetect_m1: Assertion failed) preferableBackend != DNN_BACKEND_CUDA || IS_DNN_CUDA_TARGET(preferableTarget)

Post by bzzmid »

Environment:
  • ZoneMinder v1.36.34
  • ZM Event Notification v6.1.29
  • OpenCV 4.10 installed from source as instructed on ZM ES docs
  • No NVIDIA card on my server and no CUDA OpenCV configuration enabled for build
From the LOG I get this error:

Code: Select all

Error running model: OpenCV(4.10.0-dev) /home/myuser/opencv/opencv-4.x/modules/dnn/src/net_impl.cpp:119: error: (-215:Assertion failed) preferableBackend != DNN_BACKEND_CUDA || IS_DNN_CUDA_TARGET(preferableTarget) in function 'validateBackendAndTarget'
As of now, only one of the three active monitors works fine with zmNinja pushing event against person detection. Since I'm still setting everything up, I don't event know if this error is related to that problem, on which I'm currently investigating.
I'd like to solve all logs error first, and then move on next issue.

Below is the complete log (or at least some messages before and after the error).

Code: Select all

Date/Time,Component,Server,PID,Level,Message,File,Line
"8/18/24, 7:04:34 PM GMT+2",zmc_m2,,3262639,INF,"Monitor3: 94800 - Capturing at 4.00 fps, capturing bandwidth 543246bytes/sec Analysing at 4.00 fps",zm_monitor.cpp,1680
"8/18/24, 7:04:13 PM GMT+2",zmc_m3,,3262644,INF,"Monitor1: 102300 - Capturing at 4.33 fps, capturing bandwidth 122247bytes/sec Analysing at 4.33 fps",zm_monitor.cpp,1680
"8/18/24, 7:04:11 PM GMT+2",zmc_m1,,3262634,INF,"Monitor2: 94700 - Capturing at 4.00 fps, capturing bandwidth 477583bytes/sec Analysing at 4.00 fps",zm_monitor.cpp,1680
"8/18/24, 7:04:09 PM GMT+2",zmc_m2,,3262639,INF,"Monitor3: 94700 - Capturing at 4.00 fps, capturing bandwidth 593070bytes/sec Analysing at 4.00 fps",zm_monitor.cpp,1680
"8/18/24, 7:03:50 PM GMT+2",zmc_m3,,3262644,INF,"Monitor1: 102200 - Capturing at 4.32 fps, capturing bandwidth 122650bytes/sec Analysing at 4.32 fps",zm_monitor.cpp,1680
"8/18/24, 7:03:46 PM GMT+2",zmc_m1,,3262634,INF,"Monitor2: 94600 - Capturing at 4.00 fps, capturing bandwidth 405132bytes/sec Analysing at 4.00 fps",zm_monitor.cpp,1680
"8/18/24, 7:03:44 PM GMT+2",zmc_m2,,3262639,INF,"Monitor3: 94600 - Capturing at 4.00 fps, capturing bandwidth 523360bytes/sec Analysing at 4.00 fps",zm_monitor.cpp,1680
"8/18/24, 7:03:39 PM GMT+2",zmeventnotification,,3337674,INF,"|----> FORK:Monitor2 (1), eid:909 Not sending event end alarm, as we did not send a start alarm for this, or start hook processing failed",zmeventnotification.pl,'-
"8/18/24, 7:03:37 PM GMT+2",zmeventnotification,,3337674,INF,"|----> FORK:Monitor2 (1), eid:909 end hooks/use hooks not being used, going to directly send out a notification if checks pass",zmeventnotification.pl,'-
"8/18/24, 7:03:35 PM GMT+2",zmeventnotification,,3337674,INF,"|----> FORK:Monitor2 (1), eid:909 Event 909 for Monitor 1 has finished",zmeventnotification.pl,'-
"8/18/24, 7:03:35 PM GMT+2",zmc_m1,,3262714,INF,"Monitor2: 94553 - Closing event 909, alarm end",zm_monitor.cpp,2029
"8/18/24, 7:03:35 PM GMT+2",zmc_m1,,3262714,INF,"Monitor2: 94553 - Left alarm state (909) - 41(1) images",zm_monitor.cpp,2024
"8/18/24, 7:03:33 PM GMT+2",zmeventnotification,,3337639,INF,"|----> FORK:Monitor1 (3), eid:908 Not sending event end alarm, as we did not send a start alarm for this, or start hook processing failed",zmeventnotification.pl,'-
"8/18/24, 7:03:31 PM GMT+2",zmeventnotification,,3337674,INF,"|----> FORK:Monitor2 (1), eid:909 Not sending over FCM as notify filters are on_success:all and on_fail:none",zmeventnotification.pl,'-
"8/18/24, 7:03:31 PM GMT+2",zmeventnotification,,3337639,INF,"|----> FORK:Monitor1 (3), eid:908 end hooks/use hooks not being used, going to directly send out a notification if checks pass",zmeventnotification.pl,'-
"8/18/24, 7:03:29 PM GMT+2",zmesdetect_m1,,3337678,ERR,"Error running model: OpenCV(4.10.0-dev) /home/myuser/opencv/opencv-4.x/modules/dnn/src/net_impl.cpp:119: error: (-215:Assertion failed) preferableBackend != DNN_BACKEND_CUDA || IS_DNN_CUDA_TARGET(preferableTarget) in function 'validateBackendAndTarget'",detect_sequence.py,710
"8/18/24, 7:03:29 PM GMT+2",zmeventnotification,,3337639,INF,"|----> FORK:Monitor1 (3), eid:908 Event 908 for Monitor 3 has finished",zmeventnotification.pl,'-
"8/18/24, 7:03:29 PM GMT+2",zmesdetect_m1,,3337678,ERR,"Error running model: OpenCV(4.10.0-dev) /home/myuser/opencv/opencv-4.x/modules/dnn/src/net_impl.cpp:119: error: (-215:Assertion failed) preferableBackend != DNN_BACKEND_CUDA || IS_DNN_CUDA_TARGET(preferableTarget) in function 'validateBackendAndTarget'",detect_sequence.py,710
"8/18/24, 7:03:29 PM GMT+2",zmesdetect_m1,,3337678,INF,"Connecting with ZM APIs",zm_detect.py,333
"8/18/24, 7:03:28 PM GMT+2",zmesdetect_m1,,3337678,INF,"Importing local classes for Object/Face",zm_detect.py,308
"8/18/24, 7:03:28 PM GMT+2",zmesdetect_m1,,3337678,INF,"Reading secrets from: /etc/zm/secrets.ini",utils.py,409
"8/18/24, 7:03:28 PM GMT+2",zmesdetect_m1,,3337678,INF,"Reading config from: /etc/zm/objectconfig.ini",utils.py,404
"8/18/24, 7:03:28 PM GMT+2",zmc_m3,,3262706,INF,"Monitor1: 102106 - Closing event 908, alarm end",zm_monitor.cpp,2029
"8/18/24, 7:03:28 PM GMT+2",zmc_m3,,3262706,INF,"Monitor1: 102106 - Left alarm state (908) - 60(33) images",zm_monitor.cpp,2024
"8/18/24, 7:03:28 PM GMT+2",zmesdetect_m1,,3337678,INF,"'---------| app:6.1.29, pyzm:0.3.64, ES:6.1.29 , OpenCV:4.10.0-dev|------------",zm_detect.py,283
"8/18/24, 7:03:28 PM GMT+2",zmesdetect_m1,,3337678,INF,"Switching global logger to ZMLog",ZMLog.py,301
"8/18/24, 7:03:28 PM GMT+2",zmesdetect_m1,,3337678,INF,"Setting up signal handler for logs",ZMLog.py,292
"8/18/24, 7:03:28 PM GMT+2",zmeventnotification,,3262680,INF,"PARENT: New event 909 reported for Monitor:1 (Name:Monitor2) Motion[last processed eid:904]",zmeventnotification.pl,'-
"8/18/24, 7:03:27 PM GMT+2",zmc_m3,,3262706,INF,"Monitor1: 102101 - Gone into alert state",zm_monitor.cpp,2016
"8/18/24, 7:03:27 PM GMT+2",zmc_m3,,3262644,INF,"Monitor1: 102100 - Capturing at 4.32 fps, capturing bandwidth 125030bytes/sec Analysing at 4.32 fps",zm_monitor.cpp,1680
"8/18/24, 7:03:26 PM GMT+2",zmc_m1,,3262714,INF,"Monitor2: 94519 - Gone into alert state",zm_monitor.cpp,2016
"8/18/24, 7:03:26 PM GMT+2",zmc_m1,,3262714,INF,"Monitor2: 94518 - Opening new event 909, alarm start",zm_monitor.cpp,1983
"8/18/24, 7:03:26 PM GMT+2",zmc_m1,,3262714,INF,"Monitor2: 94520 - Gone into alarm state PreAlarmCount: 0 > AlarmFrameCount:1 Cause:Motion All",zm_monitor.cpp,1976
"8/18/24, 7:03:23 PM GMT+2",zmc_m3,,3262706,INF,"Monitor1: 102082 - Gone back into alarm state",zm_monitor.cpp,2000
"8/18/24, 7:03:23 PM GMT+2",zmc_m3,,3262706,INF,"Monitor1: 102081 - Gone into alert state",zm_monitor.cpp,2016
"8/18/24, 7:03:22 PM GMT+2",zmc_m3,,3262706,INF,"Monitor1: 102080 - Gone back into alarm state",zm_monitor.cpp,2000
"8/18/24, 7:03:22 PM GMT+2",zmc_m3,,3262706,INF,"Monitor1: 102079 - Gone into alert state",zm_monitor.cpp,2016
"8/18/24, 7:03:21 PM GMT+2",zmeventnotification,,3337639,INF,"|----> FORK:Monitor1 (3), eid:908 Not sending over FCM as notify filters are on_success:all and on_fail:none",zmeventnotification.pl,'-
"8/18/24, 7:03:21 PM GMT+2",zmc_m1,,3262634,INF,"Monitor2: 94500 - Capturing at 4.00 fps, capturing bandwidth 464367bytes/sec Analysing at 4.00 fps",zm_monitor.cpp,1680
"8/18/24, 7:03:20 PM GMT+2",zmeventnotification,,3337593,INF,"|----> FORK:Monitor1 (3), eid:907 Not sending event end alarm, as we did not send a start alarm for this, or start hook processing failed",zmeventnotification.pl,'-
"8/18/24, 7:03:19 PM GMT+2",zmesdetect_m3,,3337643,ERR,"Error running model: OpenCV(4.10.0-dev) /home/myuser/opencv/opencv-4.x/modules/dnn/src/net_impl.cpp:119: error: (-215:Assertion failed) preferableBackend != DNN_BACKEND_CUDA || IS_DNN_CUDA_TARGET(preferableTarget) in function 'validateBackendAndTarget'",detect_sequence.py,710
"8/18/24, 7:03:19 PM GMT+2",zmesdetect_m3,,3337643,ERR,"Error running model: OpenCV(4.10.0-dev) /home/myuser/opencv/opencv-4.x/modules/dnn/src/net_impl.cpp:119: error: (-215:Assertion failed) preferableBackend != DNN_BACKEND_CUDA || IS_DNN_CUDA_TARGET(preferableTarget) in function 'validateBackendAndTarget'",detect_sequence.py,710
"8/18/24, 7:03:19 PM GMT+2",zmc_m2,,3262639,INF,"Monitor3: 94500 - Capturing at 4.00 fps, capturing bandwidth 558984bytes/sec Analysing at 4.00 fps",zm_monitor.cpp,1680
"8/18/24, 7:03:19 PM GMT+2",zmesdetect_m3,,3337643,INF,"Connecting with ZM APIs",zm_detect.py,333
"8/18/24, 7:03:18 PM GMT+2",zmesdetect_m3,,3337643,INF,"Importing local classes for Object/Face",zm_detect.py,308
"8/18/24, 7:03:18 PM GMT+2",zmesdetect_m3,,3337643,INF,"Reading secrets from: /etc/zm/secrets.ini",utils.py,409
"8/18/24, 7:03:18 PM GMT+2",zmesdetect_m3,,3337643,INF,"Reading config from: /etc/zm/objectconfig.ini",utils.py,404
"8/18/24, 7:03:18 PM GMT+2",zmesdetect_m3,,3337643,INF,"'---------| app:6.1.29, pyzm:0.3.64, ES:6.1.29 , OpenCV:4.10.0-dev|------------",zm_detect.py,283
"8/18/24, 7:03:18 PM GMT+2",zmeventnotification,,3337593,INF,"|----> FORK:Monitor1 (3), eid:907 end hooks/use hooks not being used, going to directly send out a notification if checks pass",zmeventnotification.pl,'-
"8/18/24, 7:03:18 PM GMT+2",zmesdetect_m3,,3337643,INF,"Switching global logger to ZMLog",ZMLog.py,301
"8/18/24, 7:03:18 PM GMT+2",zmesdetect_m3,,3337643,INF,"Setting up signal handler for logs",ZMLog.py,292
"8/18/24, 7:03:18 PM GMT+2",zmeventnotification,,3262680,INF,"PARENT: New event 908 reported for Monitor:3 (Name:Monitor1) Motion[last processed eid:907]",zmeventnotification.pl,'-
"8/18/24, 7:03:16 PM GMT+2",zmeventnotification,,3337593,INF,"|----> FORK:Monitor1 (3), eid:907 Event 907 for Monitor 3 has finished",zmeventnotification.pl,'-
"8/18/24, 7:03:16 PM GMT+2",zmc_m3,,3262706,INF,"Monitor1: 102051 - Opening new event 908, alarm start",zm_monitor.cpp,1983
"8/18/24, 7:03:16 PM GMT+2",zmc_m3,,3262706,INF,"Monitor1: 102052 - Gone into alarm state PreAlarmCount: 0 > AlarmFrameCount:1 Cause:Motion All",zm_monitor.cpp,1976
"8/18/24, 7:03:15 PM GMT+2",zmc_m3,,3262706,INF,"Monitor1: 102050 - Closing event 907, alarm end",zm_monitor.cpp,2029
"8/18/24, 7:03:15 PM GMT+2",zmc_m3,,3262706,INF,"Monitor1: 102050 - Left alarm state (907) - 78(33) images",zm_monitor.cpp,2024
"8/18/24, 7:03:14 PM GMT+2",zmc_m3,,3262706,INF,"Monitor1: 102045 - Gone into alert state",zm_monitor.cpp,2016
"8/18/24, 7:03:06 PM GMT+2",zmeventnotification,,3337593,INF,"|----> FORK:Monitor1 (3), eid:907 Not sending over FCM as notify filters are on_success:all and on_fail:none",zmeventnotification.pl,'-
"8/18/24, 7:03:05 PM GMT+2",zmc_m3,,3262706,INF,"Monitor1: 102005 - Gone back into alarm state",zm_monitor.cpp,2000
"8/18/24, 7:03:04 PM GMT+2",zmesdetect_m3,,3337597,ERR,"Error running model: OpenCV(4.10.0-dev) /home/myuser/opencv/opencv-4.x/modules/dnn/src/net_impl.cpp:119: error: (-215:Assertion failed) preferableBackend != DNN_BACKEND_CUDA || IS_DNN_CUDA_TARGET(preferableTarget) in function 'validateBackendAndTarget'",detect_sequence.py,710
"8/18/24, 7:03:04 PM GMT+2",zmesdetect_m3,,3337597,ERR,"Error running model: OpenCV(4.10.0-dev) /home/myuser/opencv/opencv-4.x/modules/dnn/src/net_impl.cpp:119: error: (-215:Assertion failed) preferableBackend != DNN_BACKEND_CUDA || IS_DNN_CUDA_TARGET(preferableTarget) in function 'validateBackendAndTarget'",detect_sequence.py,710
"8/18/24, 7:03:04 PM GMT+2",zmc_m3,,3262706,INF,"Monitor1: 102000 - Gone into alert state",zm_monitor.cpp,2016
"8/18/24, 7:03:04 PM GMT+2",zmesdetect_m3,,3337597,INF,"Connecting with ZM APIs",zm_detect.py,333
"8/18/24, 7:03:04 PM GMT+2",zmc_m3,,3262644,INF,"Monitor1: 102000 - Capturing at 4.32 fps, capturing bandwidth 125588bytes/sec Analysing at 4.32 fps",zm_monitor.cpp,1680
"8/18/24, 7:03:03 PM GMT+2",zmesdetect_m3,,3337597,INF,"Importing local classes for Object/Face",zm_detect.py,308
"8/18/24, 7:03:03 PM GMT+2",zmesdetect_m3,,3337597,INF,"Reading secrets from: /etc/zm/secrets.ini",utils.py,409
"8/18/24, 7:03:03 PM GMT+2",zmesdetect_m3,,3337597,INF,"Reading config from: /etc/zm/objectconfig.ini",utils.py,404
"8/18/24, 7:03:03 PM GMT+2",zmesdetect_m3,,3337597,INF,"'---------| app:6.1.29, pyzm:0.3.64, ES:6.1.29 , OpenCV:4.10.0-dev|------------",zm_detect.py,283
"8/18/24, 7:03:03 PM GMT+2",zmesdetect_m3,,3337597,INF,"Switching global logger to ZMLog",ZMLog.py,301
"8/18/24, 7:03:03 PM GMT+2",zmesdetect_m3,,3337597,INF,"Setting up signal handler for logs",ZMLog.py,292
User avatar
burger
Posts: 442
Joined: Mon May 11, 2020 4:32 pm

Re: Error zmesdetect_m1: Assertion failed) preferableBackend != DNN_BACKEND_CUDA || IS_DNN_CUDA_TARGET(preferableTarget)

Post by burger »

I just ran into this. I checked my other server that has ZMES running and it was 4.8, so I uninstalled 4.10, made sure to delete everything I could find for opencv, and then built 4.8 from source. That got rid of the error.

My error was the following from /var/log/zm/zmesdetect_m1.log:

Code: Select all

10/09/24 07:24:45 zmesdetect_m1[10088] ERR detect_sequence.py:710 [Error 
running model: OpenCV(4.10.0-dev) 
/root/zmeventnotification/opencv/modules/dnn/src/net_impl.cpp:119: 
error: (-215:Assertion failed) preferableBackend != DNN_BACKEND_CUDA || 
IS_DNN_CUDA_TARGET(preferableTarget) in function 
'validateBackendAndTarget' ]
My (now working) system is:
* ZM 1.36.34
* Devuan 5 (Debian 12)
* opencv 4.8
* ZMES 6.1.29
* No GPU
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
Post Reply