Skip to content

Commit

Permalink
fix edgetpu device type "None" (auto) (#7097)
Browse files Browse the repository at this point in the history
  • Loading branch information
Links2004 committed Jul 8, 2023
1 parent 691e9d2 commit 5e772c3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frigate/detectors/plugins/edgetpu_tfl.py
Expand Up @@ -27,14 +27,17 @@ class EdgeTpuTfl(DetectionApi):
type_key = DETECTOR_KEY

def __init__(self, detector_config: EdgeTpuDetectorConfig):
device_config = {"device": "usb"}
device_config = {}
if detector_config.device is not None:
device_config = {"device": detector_config.device}

edge_tpu_delegate = None

try:
logger.info(f"Attempting to load TPU as {device_config['device']}")
device_type = (
device_config["device"] if "device" in device_config else "auto"
)
logger.info(f"Attempting to load TPU as {device_type}")
edge_tpu_delegate = load_delegate("libedgetpu.so.1.0", device_config)
logger.info("TPU found")
self.interpreter = Interpreter(
Expand Down

0 comments on commit 5e772c3

Please sign in to comment.