mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-06 05:27:44 +03:00
Show correct error when wrong model is used
This commit is contained in:
parent
19342c8768
commit
1a0e0f7eb3
@ -1,4 +1,5 @@
|
|||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from pydantic import Field
|
from pydantic import Field
|
||||||
@ -45,9 +46,15 @@ class EdgeTpuTfl(DetectionApi):
|
|||||||
experimental_delegates=[edge_tpu_delegate],
|
experimental_delegates=[edge_tpu_delegate],
|
||||||
)
|
)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
logger.error(
|
_, ext = os.path.splitext(detector_config.model.path)
|
||||||
"No EdgeTPU was detected. If you do not have a Coral device yet, you must configure CPU detectors."
|
|
||||||
)
|
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
|
raise
|
||||||
|
|
||||||
self.interpreter.allocate_tensors()
|
self.interpreter.allocate_tensors()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user