Hey all - been toying around with cp.ai and I'm struggling a bit with Coral latency (I have a couple of dual-TPU M.2s). Only the Coral module installed, nothing else.
I'm seeing issues when making calls to cp.ai (from Frigate or Blue Iris, same result) where cp.ai reports that the interpreter is in use.
I've run through Google's coral getting started, and everything seems to work fine (2-3ms inference on their image classification demo).
Anything I'm missing here? I'd like to centralize my Coral TPUs and enable services to call into it, rather than use the Coral directly in Frigate, etc.
Run details:
sudo docker run --name cpai --privileged --device /dev/apex_0 -d -p 32168:32168 codeproject/ai-server
Relevant trace logs:
23:03:17:Module ObjectDetectionCoral installed successfully.
23:03:17:Module ObjectDetectionCoral not configured to AutoStart.
23:03:17:Installer exited with code 0
23:03:38:Command: /app/modules/ObjectDetectionCoral/bin/linux/python39/venv/bin/python3
23:03:38:
23:03:38:Module 'ObjectDetection (Coral)' 1.6.3 (ID: ObjectDetectionCoral)
23:03:38:Module Path: /app/modules/ObjectDetectionCoral
23:03:38:AutoStart: True
23:03:38:Starting /app...onCoral/bin/linux/python39/venv/bin/python3 "/app...ionCoral/objectdetection_coral_adapter.py"
23:03:38:
23:03:38:Attempting to start ObjectDetectionCoral with /app/modules/ObjectDetectionCoral/bin/linux/python39/venv/bin/python3 "/app/modules/ObjectDetectionCoral/objectdetection_coral_adapter.py"
23:03:38:Queue: objectdetection_queue
23:03:38:Platforms: windows,linux,linux-arm64,macos,macos-arm64
23:03:38:GPU Libraries: installed if available
23:03:38:GPU Enabled: enabled
23:03:38:Parallelism: 1
23:03:38:Accelerator:
23:03:38:Half Precis.: enable
23:03:38:Runtime: python3.9
23:03:38:Runtime Loc: Local
23:03:38:FilePath: objectdetection_coral_adapter.py
23:03:38:Pre installed: False
23:03:38:Start pause: 1 sec
23:03:38:LogVerbosity:
23:03:38:Valid: True
23:03:38:Environment Variables
23:03:38:MODELS_DIR = %CURRENT_MODULE_PATH%/assets
23:03:38:MODEL_SIZE = tiny
23:03:38:
23:03:38:Started ObjectDetection (Coral) module
23:03:40:objectdetection_coral_adapter.py: CPAI_MODULE_REQUIRED_MB not found. Setting to default 0
23:03:40:objectdetection_coral_adapter.py: NUM_THREADS not found. Setting to default 1
23:03:40:objectdetection_coral_adapter.py: MIN_CONFIDENCE not found. Setting to default 0.5
23:03:40:objectdetection_coral_adapter.py: MODULE_PATH: /app/modules/ObjectDetectionCoral
23:03:40:objectdetection_coral_adapter.py: MODELS_DIR: /app/modules/ObjectDetectionCoral/assets
23:03:40:objectdetection_coral_adapter.py: INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
23:03:40:objectdetection_coral_adapter.py: MODEL_SIZE: small
23:03:40:objectdetection_coral_adapter.py: CPU_MODEL_NAME: tf2_ssd_mobilenet_v2_coco17_ptq.tflite
23:03:40:objectdetection_coral_adapter.py: TPU_MODEL_NAME: tf2_ssd_mobilenet_v2_coco17_ptq_edgetpu.tflite
23:03:40:objectdetection_coral_adapter.py: Edge TPU detected
23:03:40:objectdetection_coral_adapter.py: Input details: {'name': 'serving_default_input:0', 'index': 0, 'shape': array([ 1, 300, 300, 3], dtype=int32), 'shape_signature': array([ 1, 300, 300, 3], dtype=int32), 'dtype': , 'quantization': (0.007843137718737125, 127), 'quantization_parameters': {'scales': array([0.00784314], dtype=float32), 'zero_points': array([127], dtype=int32), 'quantized_dimension': 0}, 'sparsity_parameters': {}}
23:03:40:objectdetection_coral_adapter.py: Output details: {'name': 'StatefulPartitionedCall:3;StatefulPartitionedCall:2;StatefulPartitionedCall:1;StatefulPartitionedCall:02', 'index': 8, 'shape': array([ 1, 20], dtype=int32), 'shape_signature': array([ 1, 20], dtype=int32), 'dtype': , 'quantization': (0.0, 0), 'quantization_parameters': {'scales': array([], dtype=float32), 'zero_points': array([], dtype=int32), 'quantized_dimension': 0}, 'sparsity_parameters': {}}
23:03:40:Request 'detect' dequeued from 'objectdetection_queue' (...45fa9b)
23:03:40:Request 'detect' dequeued from 'objectdetection_queue' (...c536c3)
23:03:40:Running init for ObjectDetection (Coral)
23:03:40:ObjectDetection (Coral): ObjectDetection (Coral) started.
23:04:37:Client request 'detect' in queue 'objectdetection_queue' (...add625)
23:04:37:Request 'detect' dequeued from 'objectdetection_queue' (...add625)
23:04:37:ObjectDetection (Coral): Retrieved objectdetection_queue command
23:04:37:ObjectDetection (Coral): [RuntimeError] : Traceback (most recent call last):
File "/app/modules/ObjectDetectionCoral/objectdetection_coral_adapter.py", line 104, in do_detection
result = do_detect(opts, img, score_threshold)
File "/app/modules/ObjectDetectionCoral/objectdetection_coral.py", line 191, in do_detect
interpreter.invoke()
File "/app/modules/ObjectDetectionCoral/bin/linux/python39/venv/lib/python3.9/site-packages/tflite_runtime/interpreter.py", line 941, in invoke
self._interpreter.Invoke()
RuntimeError: Encountered an unresolved custom op. Did you miss a custom op or delegate?Node number 4 (EdgeTpuDelegateForCustomOp) failed to invoke.
23:04:37:ObjectDetection (Coral): Rec'd request for ObjectDetection (Coral) command 'detect' (...add625) took 21ms
23:04:37:Response received (...add625)
23:04:37:Client request 'detect' in queue 'objectdetection_queue' (...c798be)
23:04:37:Request 'detect' dequeued from 'objectdetection_queue' (...c798be)
23:04:37:ObjectDetection (Coral): Retrieved objectdetection_queue command
23:04:38:ObjectDetection (Coral): Rec'd request for ObjectDetection (Coral) command 'detect' (...c798be) took 1003ms
23:04:38:Response received (...c798be): The interpreter is in use. Please try again later
23:04:38:Client request 'detect' in queue 'objectdetection_queue' (...5dc3cf)
23:04:38:Request 'detect' dequeued from 'objectdetection_queue' (...5dc3cf)
23:04:38:ObjectDetection (Coral): Retrieved objectdetection_queue command
23:04:39:ObjectDetection (Coral): Rec'd request for ObjectDetection (Coral) command 'detect' (...5dc3cf) took 1003ms
23:04:39:Response received (...5dc3cf): The interpreter is in use. Please try again later
23:04:39:Client request 'detect' in queue 'objectdetection_queue' (...93b11a)
23:04:39:Request 'detect' dequeued from 'objectdetection_queue' (...93b11a)
23:04:39:ObjectDetection (Coral): Retrieved objectdetection_queue command
23:04:40:ObjectDetection (Coral): Rec'd request for ObjectDetection (Coral) command 'detect' (...93b11a) took 1002ms
23:04:40:Response received (...93b11a): The interpreter is in use. Please try again later
23:04:40:Client request 'detect' in queue 'objectdetection_queue' (...5c8043)
23:04:40:Request 'detect' dequeued from 'objectdetection_queue' (...5c8043)
23:04:40:ObjectDetection (Coral): Retrieved objectdetection_queue command
23:04:41:ObjectDetection (Coral): Rec'd request for ObjectDetection (Coral) command 'detect' (...5c8043) took 1003ms
23:04:41:Response received (...5c8043): The interpreter is in use. Please try again later
23:04:41:Client request 'detect' in queue 'objectdetection_queue' (...718079)
23:04:41:Request 'detect' dequeued from 'objectdetection_queue' (...718079)
23:04:41:ObjectDetection (Coral): Retrieved objectdetection_queue command
23:04:42:ObjectDetection (Coral): Rec'd request for ObjectDetection (Coral) command 'detect' (...718079) took 1003ms
23:04:42:Response received (...718079): The interpreter is in use. Please try again later
23:04:42:Client request 'detect' in queue 'objectdetection_queue' (...0c35b8)
23:04:42:Request 'detect' dequeued from 'objectdetection_queue' (...0c35b8)
23:04:42:ObjectDetection (Coral): Retrieved objectdetection_queue command
23:04:43:ObjectDetection (Coral): Rec'd request for ObjectDetection (Coral) command 'detect' (...0c35b8) took 1003ms
23:04:43:Response received (...0c35b8): The interpreter is in use. Please try again later
23:04:43:Client request 'detect' in queue 'objectdetection_queue' (...6bb356)
23:04:43:Request 'detect' dequeued from 'objectdetection_queue' (...6bb356)
23:04:43:ObjectDetection (Coral): Retrieved objectdetection_queue command
23:04:44:ObjectDetection (Coral): Rec'd request for ObjectDetection (Coral) command 'detect' (...6bb356) took 1003ms
23:04:44:Response received (...6bb356): The interpreter is in use. Please try again later
23:04:44:Client request 'detect' in queue 'objectdetection_queue' (...588c5e)
23:04:44:Request 'detect' dequeued from 'objectdetection_queue' (...588c5e)
Server info (running in Proxmox):
Server version: 2.3.2-Alpha
System: Docker
Operating System: Linux (Linux 6.1.0-13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29))
CPUs: Common KVM processor
1 CPU x 4 cores. 4 logical processors (x64)
System RAM: 8 GiB
Target: Linux
BuildConfig: Release
Execution Env: Docker
Runtime Env: Production
.NET framework: .NET 7.0.13
Video adapter info:
System GPU info:
GPU 3D Usage 0%
GPU RAM Usage 0
Global Environment variables:
CPAI_APPROOTPATH = <root>
CPAI_PORT = 32168
|