From 1a0e0f7eb3ea3d0645f1117c3673e228656b95cc Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 14 Mar 2025 16:59:01 -0600 Subject: [PATCH] Show correct error when wrong model is used --- frigate/detectors/plugins/edgetpu_tfl.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/frigate/detectors/plugins/edgetpu_tfl.py b/frigate/detectors/plugins/edgetpu_tfl.py index c320bd89b..39fc46543 100644 --- a/frigate/detectors/plugins/edgetpu_tfl.py +++ b/frigate/detectors/plugins/edgetpu_tfl.py @@ -1,4 +1,5 @@ import logging +import os import numpy as np from pydantic import Field @@ -45,9 +46,15 @@ class EdgeTpuTfl(DetectionApi): experimental_delegates=[edge_tpu_delegate], ) except ValueError: - logger.error( - "No EdgeTPU was detected. If you do not have a Coral device yet, you must configure CPU detectors." - ) + _, ext = os.path.splitext(detector_config.model.path) + + if ext and ext != ".tflite": + logger.error("Incorrect model used with EdgeTPU. Only .tflite models can be used with a Coral EdgeTPU.") + else: + logger.error( + "No EdgeTPU was detected. If you do not have a Coral device yet, you must configure CPU detectors." + ) + raise self.interpreter.allocate_tensors()