google-coral / edgetpu

Coral issue tracker (and legacy Edge TPU API source)
https://coral.ai
Apache License 2.0
412 stars 124 forks source link

TPU not recognized on HA running on Odroid N2 #772

Closed john-k-mcdowell closed 1 year ago

john-k-mcdowell commented 1 year ago

Description

Running HA on Odroid N2.

Home Assistant 2023.6.3 Supervisor 2023.06.4 Operating System 10.3

Coral is showing as USB device. It changes ID after first accessed by Frigate (expected). See screenshot below:

image

In the logs, it shows TPU found immediately followed by edgetpu not detected.

''' 2023-07-03 13:09:33.724426882 [2023-07-03 08:09:33] frigate.app INFO : Starting Frigate (0.12.1-367d724) 2023-07-03 13:09:33.750104570 [2023-07-03 08:09:33] frigate.config WARNING : Customizing more than a detector model path is unsupported. 2023-07-03 13:09:33.754493409 [2023-07-03 08:09:33] frigate.app INFO : Creating directory: /tmp/cache 2023-07-03 13:09:33.758921081 [2023-07-03 08:09:33] peewee_migrate INFO : Starting migrations 2023-07-03 13:09:33.769675986 [2023-07-03 08:09:33] peewee_migrate INFO : There is nothing to migrate 2023-07-03 13:09:33.797686783 [2023-07-03 08:09:33] frigate.app INFO : Output process started: 373 2023-07-03 13:09:33.802936506 [2023-07-03 08:09:33] detector.coral INFO : Starting detection process: 372 2023-07-03 13:09:36.586597306 [2023-07-03 08:09:33] frigate.app INFO : Camera processor started for kitchenRTSP: 376 2023-07-03 13:09:36.587885445 [2023-07-03 08:09:33] frigate.detectors.plugins.edgetpu_tfl INFO : Attempting to load TPU as usb 2023-07-03 13:09:36.588956123 [2023-07-03 08:09:33] frigate.app INFO : Capture process started for kitchenRTSP: 379 2023-07-03 13:09:36.589471545 [2023-07-03 08:09:36] frigate.detectors.plugins.edgetpu_tfl INFO : TPU found 2023-07-03 13:09:36.589833632 Process detector:coral: 2023-07-03 13:09:36.590227095 [2023-07-03 08:09:36] frigate.detectors.plugins.edgetpu_tfl ERROR : No EdgeTPU was detected. If you do not have a Coral device yet, you must configure CPU detectors. '''

following this error Frigate stops running.

Any ideas on how to troubleshoot would be greatly appreciated.

Issue Type

Build/Install

Operating System

Linux

Coral Device

No response

Other Devices

No response

Programming Language

No response

Relevant Log Output

2023-07-03 13:09:33.724426882  [2023-07-03 08:09:33] frigate.app                    INFO    : Starting Frigate (0.12.1-367d724)
2023-07-03 13:09:33.750104570  [2023-07-03 08:09:33] frigate.config                 WARNING : Customizing more than a detector model path is unsupported.
2023-07-03 13:09:33.754493409  [2023-07-03 08:09:33] frigate.app                    INFO    : Creating directory: /tmp/cache
2023-07-03 13:09:33.758921081  [2023-07-03 08:09:33] peewee_migrate                 INFO    : Starting migrations
2023-07-03 13:09:33.769675986  [2023-07-03 08:09:33] peewee_migrate                 INFO    : There is nothing to migrate
2023-07-03 13:09:33.797686783  [2023-07-03 08:09:33] frigate.app                    INFO    : Output process started: 373
2023-07-03 13:09:33.802936506  [2023-07-03 08:09:33] detector.coral                 INFO    : Starting detection process: 372
2023-07-03 13:09:36.586597306  [2023-07-03 08:09:33] frigate.app                    INFO    : Camera processor started for kitchenRTSP: 376
2023-07-03 13:09:36.587885445  [2023-07-03 08:09:33] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
2023-07-03 13:09:36.588956123  [2023-07-03 08:09:33] frigate.app                    INFO    : Capture process started for kitchenRTSP: 379
2023-07-03 13:09:36.589471545  [2023-07-03 08:09:36] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
2023-07-03 13:09:36.589833632  Process detector:coral:
2023-07-03 13:09:36.590227095  [2023-07-03 08:09:36] frigate.detectors.plugins.edgetpu_tfl ERROR   : No EdgeTPU was detected. If you do not have a Coral device yet, you must configure CPU detectors.
easy-and-simple commented 1 year ago

You didn't explained anything! No SBC configuration, no HA type of installation and configuration, no Frigate type of installation and configuration. But you have supplied SBC model. And how this information is useful in this case? Also coral device is set to??? no response. My helpful advice is, that at first you need to own edgetpu device, and at second you need to connect it to SBC, and if you follow the logic, the third thing that you need to do according to the logic, I suppose is causing your problem.

john-k-mcdowell commented 1 year ago

Sorry if the information above was not clear or sufficient. HA is installed via HAOS. All version info is above. The coral is plugged into the upper left USB 3 port. The "Bus 2 Device 4 ID 18D1:9302" is the coral (this is all I get with lsusb with the HA terminal Add on. None of the flags for lsusb work for this minimal Linux distro. However, this is the ID it shows after the first time accessed by Frigate based on other posts trying to resolve similar issues.

Frigate (Full Access) protected mode off, version 0.12.1 installed from HA Add-On store as a HA Add on. I tried with protected mode on and the non full access version. All give the same results.

Configuration file is:

''' mqtt: enabled: False

detectors: coral: type: edgetpu device: usb model: path: "/custom_model.tflite" cameras: kitchenRTSP: # <------ Name the camera ffmpeg: inputs:

john-k-mcdowell commented 1 year ago

config file formatted correctly: `mqtt: enabled: False

detectors: coral: type: edgetpu device: usb model: path: "/custom_model.tflite" cameras: kitchenRTSP: # <------ Name the camera ffmpeg: inputs:

easy-and-simple commented 1 year ago

You have this problem because you don't understand the basics of that how things are worked. Config you supply is some post config settings. I don't know what config you have supplied but frigate runs in docker container that have configuration you have not supplied

easy-and-simple commented 1 year ago

You should:

  1. follow edgetpu installation guide and get clasification result to make sure it is working - https://coral.ai/docs/accelerator/get-started/
  2. Install docked by correctly set edgeptu device passed to the docker container - https://docs.frigate.video/frigate/installation
  3. install HA frigate plugin after make sure both steps above are successful
john-k-mcdowell commented 1 year ago

Sorry, I will close this issue as you obviously are not familiar enough with the HA Frigate Add-On (which is supposed to make it easier to get Frigate running). The docker settings you are referring to are all part of the add-on. As I have said in all of my posts, the Frigate container runs fine until i try to get it to find the TPU. However, since I use HAOS and it supervisor debugging can sometimes be challenging due to its restrictions.

easy-and-simple commented 1 year ago

I see, problem that coral is not working for you, is not in you, it is not in home assistant, it is not in frigate, it is in me haha.

john-k-mcdowell commented 1 year ago

I have tried to be respectful in this entire thread and all you have done is try to put me down. I realize these tools are all open source and no one is being paid for their work, but being a wise ass to people asking questions and trying to learn does no one any good. (I engage with many github projects and various communities, fortunately you are the first person I have run into that has behaved this way). As for the Coral not working, it is obviously something I don't have configured correctly either in HA or the Frigate setup file, I'm just not going to figure it out the issue from you since you obviously have no intent to try to help. I will find a different avenue to find a solution. Sorry for wasting your time.