asmirnou / watsor

Object detection for video surveillance
MIT License
254 stars 32 forks source link

Coral Stick #11

Closed jasonmadigan closed 4 years ago

jasonmadigan commented 4 years ago

Not sure why, but my Coral USB stick doesn't seem work. Seeing errors like this in the logs.

watchdog WatchDog DEBUG : Thread frontlawn (Snapshot) is alive
watchdog WatchDog DEBUG : Process detector1 (ObjectDetector) is alive
detector1 ObjectDetector ERROR : Detection failure

Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/watsor/detection/detector.py", line 86, in _run
with detector_class(*detector_args) as object_detector:
File "/usr/local/lib/python3.6/dist-packages/watsor/detection/edge_tpu.py", line 15, in __init__
device_path=device_path)
File "/usr/lib/python3/dist-packages/edgetpu/detection/engine.py", line 71, in __init__
super().__init__(model_path, device_path)
File "/usr/lib/python3/dist-packages/edgetpu/basic/basic_engine.py", line 90, in __init__
model_path, device_path)
RuntimeError: Error in device opening (/sys/bus/usb/devices/1-5)!

I see a nameless detector noted in the metrics endpoint:

    "detectors": [
        {
            "name": "",
            "fps": 0.0,
            "fps_max": 0.0,
            "inference_time": 0.0
        }
    ]

It is mounted, via:

/dev/bus/usb:/dev/bus/usb

And can confirm it's mounted from the host.

asmirnou commented 4 years ago

If you're on Raspberry Pi 3 or 4, check troubleshooting section. In order to detect USB accelerator the protection mode must be enabled in Hassio add-on. Without the add-on Docker image for Raspberry Pi must be run in privileged mode, otherwise Coral USB stick will work sporadically. This is because of the peculiarities of the UDEV in the Docker image.

jasonmadigan commented 4 years ago

Not a pi, as it turns out this seemed to be related to the pci USB3 hub i had on an older machine. Using a USB2 port seems to work ok!