Hi,
I just got my Google Coral, and I now want to use it for Frigate.
Unfortunately, even when I forwarded it as a device (or volume, as I found online) in docker, it is not initializing. When I run lsusb in the jail shell, it recognizes the device, so to my knowledge, it is passing it through to Frigate as per the docker config. I tried three
different cables, USB ports, and powering the Coral through a powered USB-C hub.
No matter what I try, it always recognizes the TPU but never initializes it.
What am I doing wrong?
lsusb results:
1a6e:089a Global Unichip Corp.
what it should change to after initializing:
18d1:9302 Google Inc.
docker-compose.yml:
version: "3.9"
services:
frigate:
container_name: frigate
privileged: true # this may not be necessary for all setups
restart: unless-stopped
image: ghcr.io/blakeblackshear/frigate:stable
shm_size: "128mb" # update for your cameras based on calculation above
devices:
- /dev/bus/usb:/dev/bus/usb # Passes the USB Coral, needs to be modified for other versions
#- /dev/apex_0:/dev/apex_0 # Passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
#- /dev/video11:/dev/video11 # For Raspberry Pi 4B
#- /dev/dri/renderD128:/dev/dri/renderD128 # For intel hwaccel, needs to be updated for your hardware
volumes:
- /etc/localtime:/etc/localtime:ro
- /path/to/your/config:/config
- /path/to/your/storage:/media/frigate
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- "5000:5000"
- "8554:8554" # RTSP feeds
- "8555:8555/tcp" # WebRTC over tcp
- "8555:8555/udp" # WebRTC over udp
environment:
FRIGATE_RTSP_PASSWORD: "password"
frigate config:
mqtt:
enabled: false
** camera config **
snapshots:
enabled: true
timestamp: true
bounding_box: true
retain:
default: 14
record:
enabled: true
retain:
days: 2
mode: all
events:
retain:
default: 10
ui:
live_mode: webrtc
detectors:
coral:
type: edgetpu
device: usb
frigate logs:
2024-06-02 20:16:31.230885953 Process detector:coral:
2024-06-02 20:16:31.230904563 [2024-06-02 20:16:31] frigate.detectors.plugins.edgetpu_tfl INFO : Attempting to load TPU as usb
2024-06-02 20:16:31.230924732 [2024-06-02 20:16:31] frigate.detectors.plugins.edgetpu_tfl ERROR : No EdgeTPU was detected. If you do not have a Coral device yet, you must configure CPU detectors.
2024-06-02 20:16:31.231375259 Traceback (most recent call last):
2024-06-02 20:16:31.231382369 File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 160, in load_delegate
2024-06-02 20:16:31.231382729 delegate = Delegate(library, options)
2024-06-02 20:16:31.231383139 File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 119, in __init__
2024-06-02 20:16:31.231384019 raise ValueError(capture.message)
2024-06-02 20:16:31.231387539 ValueError
2024-06-02 20:16:31.231390559
2024-06-02 20:16:31.231390969 During handling of the above exception, another exception occurred:
2024-06-02 20:16:31.231391249
2024-06-02 20:16:31.231394489 Traceback (most recent call last):
2024-06-02 20:16:31.231407159 File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
2024-06-02 20:16:31.231407559 self.run()
2024-06-02 20:16:31.231407939 File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
2024-06-02 20:16:31.231408339 self._target(*self._args, **self._kwargs)
2024-06-02 20:16:31.231408699 File "/opt/frigate/frigate/object_detection.py", line 102, in run_detector
2024-06-02 20:16:31.231409099 object_detector = LocalObjectDetector(detector_config=detector_config)
2024-06-02 20:16:31.231413019 File "/opt/frigate/frigate/object_detection.py", line 53, in __init__
2024-06-02 20:16:31.231413389 self.detect_api = create_detector(detector_config)
2024-06-02 20:16:31.231413739 File "/opt/frigate/frigate/detectors/__init__.py", line 18, in create_detector
2024-06-02 20:16:31.231414019 return api(detector_config)
2024-06-02 20:16:31.231414389 File "/opt/frigate/frigate/detectors/plugins/edgetpu_tfl.py", line 41, in __init__
2024-06-02 20:16:31.231414789 edge_tpu_delegate = load_delegate("libedgetpu.so.1.0", device_config)
2024-06-02 20:16:31.231415189 File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 162, in load_delegate
2024-06-02 20:16:31.231422329 raise ValueError('Failed to load delegate from {}\n{}'.format(
2024-06-02 20:16:31.231426069 ValueError: Failed to load delegate from libedgetpu.so.1.0
Thanks