Coral USB problem
Posted: Sat Jan 06, 2024 1:17 pm
Hello,
im trying to run the Coral USB on the ES.
Pycoral examples is working:
im trying to run the Coral USB on the ES.
sudo -u www-data /var/lib/zmeventnotification/bin/zm_detect.py --config /etc/zm/objectconfig.ini --debug --eventid 1 --monitorid 1
01/06/24 14:04:28 zmesdetect_m1[58497] INF ZMLog.py:292 [Setting up signal handler for logs]
01/06/24 14:04:28 zmesdetect_m1[58497] INF ZMLog.py:301 [Switching global logger to ZMLog]
01/06/24 14:04:28 zmesdetect_m1[58497] DBG1 zm_detect.py:267 [---------| app:6.1.29, pyzm:0.3.63, ES:(?) , OpenCV:4.6.0|------------]
01/06/24 14:04:29 zmesdetect_m1[58497] INF utils.py:404 [Reading config from: /etc/zm/objectconfig.ini]
01/06/24 14:04:29 zmesdetect_m1[58497] INF utils.py:409 [Reading secrets from: /etc/zm/secrets.ini]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 utils.py:381 [Secret token found in config: !ZM_PORTAL]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 utils.py:381 [Secret token found in config: !ZM_USER]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 utils.py:381 [Secret token found in config: !ZM_PASSWORD]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 utils.py:381 [Secret token found in config: !ZM_API_PORTAL]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 utils.py:381 [Secret token found in config: !ML_USER]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 utils.py:381 [Secret token found in config: !ML_PASSWORD]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 utils.py:381 [Secret token found in config: !PLATEREC_ALPR_KEY]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG1 utils.py:444 [allowing self-signed certs to work...]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 utils.py:454 [Now checking for monitor overrides]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG3 utils.py:521 [Finally, doing parameter substitution]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG1 zm_detect.py:301 [Importing local classes for Object/Face]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG1 zm_detect.py:326 [Connecting with ZM APIs]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 api.py:69 [API SSL certificate check has been disbled]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG1 api.py:173 [using username/password for login]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 api.py:202 [Using new token API]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 zm_detect.py:334 [using ml_sequence]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 zm_detect.py:346 [using stream_sequence]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG1 detect_sequence.py:160 [Resetting models, will be loaded on next run]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG3 detect_sequence.py:634 [Using automatic locking as we are switching between models]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 Media.py:51 [Media get SSL certificate check has been disbled]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 Media.py:99 [Using URL 1 for stream]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 Media.py:114 [We will only process frames: ['snapshot', 'alarm']]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 Media.py:137 [No need to start streams, we are picking images from https://192.168.178.191/zm/index.php?view=image&eid=1]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG3 Media.py:271 [Reading https://192.168.178.191/zm/index.php?vi ... d=snapshot]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG3 api.py:263 [make_request called with url=https://192.168.178.191/zm/index.php?vi ... d=snapshot payload={} type=get query={'token': None}]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG1 detect_sequence.py:654 [perf: Starting for frame:snapshot]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG1 detect_sequence.py:664 [Sequence of detection types to execute: ['object', 'face', 'alpr']]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG1 detect_sequence.py:669 [============ Frame: snapshot Running object detection type in sequence ==================]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 detect_sequence.py:178 [Loading sequence: TPU object detection]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 detect_sequence.py:179 [Initializing model type:object with options:{'name': 'TPU object detection', 'enabled': 'yes', 'object_weights': '/var/lib/zmeventnotification/models/coral_edgetpu/ssdlite_mobiledet_coco_qat_postprocess_edgetpu.tflite', 'object_labels': '/var/lib/zmeventnotification/models/coral_edgetpu/coco_indexed.names', 'object_min_confidence': 0.6, 'object_framework': 'coral_edgetpu', 'tpu_max_processes': 1, 'tpu_max_lock_wait': 100, 'max_detection_size': '90%', 'disable_locks': 'no'}]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 coral_edgetpu.py:37 [portalock: max:1, name:pyzm_uid33_tpu_lock, timeout:100]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 detect_sequence.py:178 [Loading sequence: YoloV4 GPU/CPU]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 detect_sequence.py:179 [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': 1, 'gpu_max_lock_wait': 100, 'cpu_max_processes': 3, 'cpu_max_lock_wait': 100, 'max_detection_size': '90%', 'disable_locks': 'no'}]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 yolo.py:54 [portalock: max:1, name:pyzm_uid33_gpu_lock, timeout:100]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG3 detect_sequence.py:689 [object has a same_model_sequence strategy of first]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG1 detect_sequence.py:701 [--------- Frame:snapshot Running variation: #1 -------------]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 coral_edgetpu.py:51 [Waiting for pyzm_uid33_tpu_lock portalock...]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG2 coral_edgetpu.py:53 [Got pyzm_uid33_tpu_lock portalock]
01/06/24 14:04:29 zmesdetect_m1[58497] DBG1 coral_edgetpu.py:89 [|--------- Loading "TPU object detection" model from disk -------------|]
Segmentation fault
Pycoral examples is working:
python3 examples/classify_image.py --model test_data/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite --labels test_data/inat_bird_labels.txt --input test_data/parrot.jpg /root/coral/pycoral/examples/classify_image.py:79: DeprecationWarning: ANTIALIAS is deprecated and will be removed in Pillow 10 (2023-07-01). Use LANCZOS or Resampling.LANCZOS instead.
image = Image.open(args.input).convert('RGB').resize(size, Image.ANTIALIAS)
----INFERENCE TIME----
Note: The first inference on Edge TPU is slow because it includes loading the model into Edge TPU memory.
13.6ms
4.3ms
4.4ms
4.3ms
4.3ms
-------RESULTS--------
Ara macao (Scarlet Macaw): 0.75781
ls -al /dev/bus/usb/002/
total 0
drwxr-xr-x 2 root root 80 Jan 5 23:19 .
drwxr-xr-x 3 root root 60 Jan 5 23:56 ..
crw-rw-r-- 1 root root 189, 128 Jan 5 18:51 001
crw-rw---- 1 root plugdev 189, 131 Jan 6 14:08 004
can someone help me?lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm