[SOLVED] c++ stl_vector.h issue (ArchLinux)

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
Post Reply
fiatguy85
Posts: 6
Joined: Fri Jan 20, 2023 4:36 am

[SOLVED] c++ stl_vector.h issue (ArchLinux)

Post by fiatguy85 »

I'm having an issue with the event server, which was working until a week ago, when I ran an update on the server. Looking at the error log, it appears to be calling for an incorrect c++ program in 12.2.0, when 12.2.1 is installed. I'm not sure if this is an issue in the event server itself, or possibly in another package, but if someone has a suggestion on which program I might need to check or recompile, the help would be appreciated.

Code: Select all

sudo -u http /var/lib/zmeventnotification/bin/zm_detect.py --config /etc/zoneminder/objectconfig.ini --eventid 10768 --debug --monitorid 1 --output-path /tmp --eventpath /tmp
01/19/23 23:43:43 zmesdetect_m1[42989] INF ZMLog.py:292 [Setting up signal handler for logs]

01/19/23 23:43:43 zmesdetect_m1[42989] INF ZMLog.py:301 [Switching global logger to ZMLog]

01/19/23 23:43:43 zmesdetect_m1[42989] INF zm_detect.py:284 [---------| app:6.1.28, pyzm:0.3.56, ES:6.1.28
 , OpenCV:4.7.0|------------]

01/19/23 23:43:43 zmesdetect_m1[42989] INF utils.py:405 [Reading config from: /etc/zoneminder/objectconfig.ini]

01/19/23 23:43:43 zmesdetect_m1[42989] INF utils.py:410 [Reading secrets from: /etc/zm/secrets.ini]

DBG2 [zmesdetect_m1] [Secret token found in config: !ZM_PORTAL]
DBG2 [zmesdetect_m1] [Secret token found in config: !ZM_USER]
DBG2 [zmesdetect_m1] [Secret token found in config: !ZM_PASSWORD]
DBG2 [zmesdetect_m1] [Secret token found in config: !ZM_API_PORTAL]
DBG2 [zmesdetect_m1] [Secret token found in config: !ML_USER]
DBG2 [zmesdetect_m1] [Secret token found in config: !ML_PASSWORD]
DBG2 [zmesdetect_m1] [Secret token found in config: !PLATEREC_ALPR_KEY]
DBG1 [zmesdetect_m1] [strict SSL cert checking is on...]
DBG2 [zmesdetect_m1] [Now checking for monitor overrides]
DBG2 [zmesdetect_m1] [enabled is not a polygon, adding it as unknown string key]
DBG3 [zmesdetect_m1] [[monitor-1] overrides key:match_past_detections with value:no]
DBG3 [zmesdetect_m1] [[monitor-1] overrides key:wait with value:2]
DBG3 [zmesdetect_m1] [[monitor-1] overrides key:object_detection_pattern with value:(person|car|motorbike|bus|truck)]
DBG3 [zmesdetect_m1] [[monitor-1] overrides key:import_zm_zones with value:yes]
DBG2 [zmesdetect_m1] [found zone specific pattern:porch storing]
DBG2 [zmesdetect_m1] [found zone specific pattern:street storing]
DBG3 [zmesdetect_m1] [[monitor-1] overrides key:resize with value:no]
DBG2 [zmesdetect_m1] [my_model_sequence is not a polygon, adding it as unknown string key]
DBG2 [zmesdetect_m1] [import_zm_zones: match_reason=False and reason=None]
DBG2 [zmesdetect_m1] [Getting ZM zones using https://zoneminder.xxxx.yyyy.org/api/zones/forMonitor/1.json?username=xxx&password=yyy&user=xxx&pass=yyy]
DBG2 [zmesdetect_m1] [importing zoneminder polygon: porch [834,511 1875,575 2559,382 2559,1919 871,1919 877,1770 793,1076]]
DBG2 [zmesdetect_m1] [importing zoneminder polygon: street [812,1060 2559,1038 2559,1186 823,1262]]
DBG2 [zmesdetect_m1] [replacing match pattern for polygon:porch with: (person)]
DBG2 [zmesdetect_m1] [replacing match pattern for polygon:street with: (car|person|motorbike|bus|truck)]
DBG3 [zmesdetect_m1] [Finally, doing parameter substitution]
DBG1 [zmesdetect_m1] [Output path modified to /tmp]
01/19/23 23:43:43 zmesdetect_m1[42989] INF zm_detect.py:309 [Importing local classes for Object/Face]

01/19/23 23:43:43 zmesdetect_m1[42989] INF zm_detect.py:334 [Connecting with ZM APIs]

DBG1 [zmesdetect_m1] [using username/password for login]
DBG2 [zmesdetect_m1] [Using new token API]
DBG1 [zmesdetect_m1] [Access token expires on:2023-01-20 01:43:43.689552 [7200s]]
DBG1 [zmesdetect_m1] [Refresh token expires on:2023-01-20 23:43:43.689778 [86400s]]
DBG2 [zmesdetect_m1] [using ml_sequence]
DBG2 [zmesdetect_m1] [using stream_sequence]
01/19/23 23:43:43 zmesdetect_m1[42989] INF zm_detect.py:418 [Sleeping for 2 seconds before inferencing]

DBG1 [zmesdetect_m1] [Resetting models, will be loaded on next run]
DBG3 [zmesdetect_m1] [Using automatic locking as we are switching between models]
DBG2 [zmesdetect_m1] [Media get SSL certificate check has been disbled]
DBG2 [zmesdetect_m1] [Using URL 10768 for stream]
DBG2 [zmesdetect_m1] [We will only process frames: ['snapshot', 'alarm', '16', '31', '46', '60']]
DBG2 [zmesdetect_m1] [No need to start streams, we are picking images from https://xxxx.yyyy.duckdns.org/index.php?view=image&eid=10768]
DBG3 [zmesdetect_m1] [Reading https://xxxx.yyyy.duckdns.org/index.php?view=image&eid=10768&fid=snapshot]
DBG3 [zmesdetect_m1] [No need to relogin as access token still has 119.9665651 minutes remaining]
DBG3 [zmesdetect_m1] [make_request called with url=https://xxxx.yyyy.duckdns.org/index.php?view=image&eid=10768&fid=snapshot payload={} type=get query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjc0MTg5ODIzLCJleHAiOjE2NzQxOTcwMjMsInVzZXIiOiJqb2huMiIsInR5cGUiOiJhY2Nlc3MifQ.7HhQa1tAKtbdGSlUQN6TdAGzzM5q5rEPJCCVE8AnaGM'}]
DBG1 [zmesdetect_m1] [perf: Starting for frame:snapshot]
DBG1 [zmesdetect_m1] [Sequence of detection types to execute: ['object', 'face']]
DBG1 [zmesdetect_m1] [============ Frame: snapshot Running object detection type in sequence ==================]
DBG2 [zmesdetect_m1] [Skipping TPU object detection as it is disabled]
DBG2 [zmesdetect_m1] [Loading sequence: YoloV4 GPU/CPU]
DBG2 [zmesdetect_m1] [Initializing model  type:object with options:{'name': 'YoloV4 GPU/CPU', 'enabled': 'yes', 'object_config': '/var/lib/zmeventnotification/models/yolov4/yolov4.cfg', 'object_weights': '/var/lib/zmeventnotification/models/yolov4/yolov4.weights', 'object_labels': '/var/lib/zmeventnotification/models/yolov4/coco.names', 'object_min_confidence': 0.3, 'object_framework': 'opencv', 'object_processor': 'gpu', 'gpu_max_processes': 7, 'gpu_max_lock_wait': 120, 'cpu_max_processes': 15, 'cpu_max_lock_wait': 120, 'max_detection_size': '90%', 'disable_locks': 'no'}]
DBG2 [zmesdetect_m1] [portalock: max:7, name:pyzm_uid33_gpu_lock, timeout:120]
DBG3 [zmesdetect_m1] [object has a same_model_sequence strategy of most]
DBG1 [zmesdetect_m1] [--------- Frame:snapshot Running variation: #1 -------------]
DBG2 [zmesdetect_m1] [detect extracted image dimensions as: 1080wx810h]
DBG2 [zmesdetect_m1] [Waiting for pyzm_uid33_gpu_lock portalock...]
DBG2 [zmesdetect_m1] [Got pyzm_uid33_gpu_lock portalock]
DBG1 [zmesdetect_m1] [|--------- Loading "YoloV4 GPU/CPU" model from disk -------------|]
DBG1 [zmesdetect_m1] [You are using OpenCV >= 4.5.4, making sure we fix getUnconnectedOutLayers() API]
DBG1 [zmesdetect_m1] [perf: processor:gpu Yolo initialization (loading /var/lib/zmeventnotification/models/yolov4/yolov4.weights model from disk) took: 42.07 ms]
DBG2 [zmesdetect_m1] [Setting CUDA backend for OpenCV]
DBG3 [zmesdetect_m1] [If you did not set your CUDA_ARCH_BIN correctly during OpenCV compilation, you will get errors during detection related to invalid device/make_policy]
DBG1 [zmesdetect_m1] [|---------- YOLO (input image: 1080w*810h, model resize dimensions: 416w*416h) ----------|]
[ WARN:0@2.777] global net_impl.cpp:174 setUpNet DNN module was not built with CUDA backend; switching to CPU
/usr/include/c++/12.2.0/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = float; _Alloc = std::allocator<float>; reference = float&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
/usr/include/c++/12.2.0/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = float; _Alloc = std::allocator<float>; reference = float&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
/usr/include/c++/12.2.0/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = float; _Alloc = std::allocator<float>; reference = float&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
[1]    42988 IOT instruction  sudo -u http /var/lib/zmeventnotification/bin/zm_detect.py --config  --eventi
Last edited by fiatguy85 on Sat Jan 21, 2023 12:54 am, edited 1 time in total.
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: c++ stl_vector.h issue

Post by Magic919 »

That number version is very likely CUDA. Look at repeating your OpenCV install steps.
-
fiatguy85
Posts: 6
Joined: Fri Jan 20, 2023 4:36 am

Re: c++ stl_vector.h issue

Post by fiatguy85 »

Ok, that did the trick. I'm on ArchLinux and I guess the issue is with the standard OpenCV package. I switched over to git packages in the AUR (opencv-git and python-opencv-git, basically compiled from source) and now it is working once again.
Post Reply