From 1e6c1bc33180f6cf584ac2b22cc799da54e352c4 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Mon, 7 Jul 2025 17:45:39 -0600 Subject: [PATCH] Move trt error --- frigate/detectors/plugins/tensorrt.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/frigate/detectors/plugins/tensorrt.py b/frigate/detectors/plugins/tensorrt.py index b46c24f1f..03cc87f5f 100644 --- a/frigate/detectors/plugins/tensorrt.py +++ b/frigate/detectors/plugins/tensorrt.py @@ -43,14 +43,6 @@ if TRT_SUPPORT: return logging.CRITICAL else: return logging.DEBUG -elif platform.machine() == "x86_64": - logger.error( - "TensorRT detector is no longer supported on amd64 system. Please use ONNX detector instead, see https://docs.frigate.video/configuration/object_detectors#onnx for more information." - ) - raise ImportError( - "TensorRT detector is no longer supported on amd64 system. Please use ONNX detector instead, see https://docs.frigate.video/configuration/object_detectors#onnx for more information." - ) - class TensorRTDetectorConfig(BaseDetectorConfig): type: Literal[DETECTOR_KEY] @@ -227,6 +219,15 @@ class TensorRtDetector(DetectionApi): ] def __init__(self, detector_config: TensorRTDetectorConfig): + if platform.machine() == "x86_64": + logger.error( + "TensorRT detector is no longer supported on amd64 system. Please use ONNX detector instead, see https://docs.frigate.video/configuration/object_detectors#onnx for more information." + ) + raise ImportError( + "TensorRT detector is no longer supported on amd64 system. Please use ONNX detector instead, see https://docs.frigate.video/configuration/object_detectors#onnx for more information." + ) + + assert TRT_SUPPORT, ( f"TensorRT libraries not found, {DETECTOR_KEY} detector not present" )