[HW Accel Support]: AttributeError: 'TensorRtDetector' object has no attribute 'outputs' #15470
-
Describe the problem you are havingOn a TrueNAS Scale instance I am trying to set up a frigate instance with nvidia passthrough with a 3060 RTX (Have also tried Nvidia L4 and Nvidia 1080). In a single instance, I am able to build the model, but then it fails to use it. TrueNAS Scale docker config: If I change the detector to Other's with the issue seem to have mount path issues (not applicable here as it's in a single instance) or forget to rebuild between card switches, which is also not issue seen here to my knowledge. Versionstable-tensorrt Frigate config filemqtt:
enabled: false
detectors:
detector_name:
type: tensorrt
cameras:
front:
enabled: true
ffmpeg:
hwaccel_args: preset-nvidia-h265
inputs:
- path: rtsp://...
roles:
- detect
- path: rtsp://...
roles:
- record
detect:
enabled: true
width: 640
height: 480
fps: 5
driveway:
enabled: true
ffmpeg:
hwaccel_args: preset-nvidia-h265
inputs:
- path: rtsp://...
roles:
- detect
- path: rtsp://...
roles:
- record
detect:
enabled: true
width: 640
height: 480
fps: 5
backyard:
enabled: true
ffmpeg:
hwaccel_args: preset-nvidia-h265
inputs:
- path: rtsp://...
roles:
- detect
- path: rtsp://...
roles:
- record
detect:
enabled: true
width: 640
height: 480
fps: 5
garden:
enabled: true
ffmpeg:
hwaccel_args: preset-nvidia-h265
inputs:
- path: rtsp://...
roles:
- detect
- path: rtsp://...
roles:
- record
detect:
enabled: true
width: 640
height: 480
fps: 5
catroom:
enabled: true
ffmpeg:
hwaccel_args: preset-nvidia-h264
inputs:
- path: rtsp://...
roles:
- detect
- path: rtsp://...
roles:
- record
detect:
enabled: true
width: 640
height: 480
fps: 5
auth:
reset_admin_password: false
version: 0.14
record:
enabled: true
events:
pre_capture: 10
post_capture: 10
retain:
mode: all
snapshots:
enabled: true docker-compose file or Docker CLI commandN/A Relevant Frigate log output2024-12-12 03:54:17.339306+00:00Creating yolov7-320.cfg and yolov7-320.weights
2024-12-12 03:54:17.342354+00:002024-12-12T03:54:17.342354857Z
2024-12-12 03:54:17.342368+00:00Done.
2024-12-12 03:54:21.149334+00:002024-12-12T03:54:21.149334902Z
2024-12-12 03:54:21.149375+00:00Generating yolov7-320.trt. This may take a few minutes.
2024-12-12 03:54:21.149403+00:002024-12-12T03:54:21.149403971Z
2024-12-12 03:54:22.875875+00:00/usr/local/src/tensorrt_demos/yolo/onnx_to_tensorrt.py:149: DeprecationWarning: Use network created with NetworkDefinitionCreationFlag::EXPLICIT_BATCH flag instead.
2024-12-12 03:54:22.875972+00:00builder.max_batch_size = MAX_BATCH_SIZE
2024-12-12 03:54:22.876041+00:00/usr/local/src/tensorrt_demos/yolo/onnx_to_tensorrt.py:151: DeprecationWarning: Use set_memory_pool_limit instead.
2024-12-12 03:54:22.876089+00:00config.max_workspace_size = 1 << 30
2024-12-12 03:54:22.876099+00:00/usr/local/src/tensorrt_demos/yolo/onnx_to_tensorrt.py:174: DeprecationWarning: Use build_serialized_network instead.
2024-12-12 03:54:22.876108+00:00engine = builder.build_engine(network, config)
2024-12-12 03:56:27.014371+00:00Generated yolov7-320.trt in 126 seconds
2024-12-12 03:56:27.014414+00:00Available tensorrt models:
2024-12-12 03:56:27.015493+00:00yolov7-320.trt
2024-12-12 03:56:27.016099+00:00s6-rc: info: service trt-model-prepare successfully started
2024-12-12 03:56:27.016230+00:00s6-rc: info: service frigate: starting
2024-12-12 03:56:27.018017+00:00s6-rc: info: service frigate successfully started
2024-12-12 03:56:27.018126+00:00s6-rc: info: service nginx: starting
...
2024-12-12 03:56:30.919941+00:002024-12-12 03:56:30.919882654 Process detector:detector_name:
2024-12-12 03:56:30.920489+00:002024-12-12 03:56:30.920457370 Traceback (most recent call last):
2024-12-12 03:56:30.920514+00:002024-12-12 03:56:30.920475313 File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
2024-12-12 03:56:30.920545+00:002024-12-12 03:56:30.920476355 self.run()
2024-12-12 03:56:30.920560+00:002024-12-12 03:56:30.920477057 File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
2024-12-12 03:56:30.920571+00:002024-12-12 03:56:30.920477628 self._target(*self._args, **self._kwargs)
2024-12-12 03:56:30.920594+00:002024-12-12 03:56:30.920485522 File "/opt/frigate/frigate/object_detection.py", line 102, in run_detector
2024-12-12 03:56:30.920603+00:002024-12-12 03:56:30.920486113 object_detector = LocalObjectDetector(detector_config=detector_config)
2024-12-12 03:56:30.920611+00:002024-12-12 03:56:30.920486675 File "/opt/frigate/frigate/object_detection.py", line 53, in __init__
2024-12-12 03:56:30.920633+00:002024-12-12 03:56:30.920487185 self.detect_api = create_detector(detector_config)
2024-12-12 03:56:30.920642+00:002024-12-12 03:56:30.920487716 File "/opt/frigate/frigate/detectors/__init__.py", line 18, in create_detector
2024-12-12 03:56:30.920651+00:002024-12-12 03:56:30.920491373 return api(detector_config)
2024-12-12 03:56:30.920660+00:002024-12-12 03:56:30.920491934 File "/opt/frigate/frigate/detectors/plugins/tensorrt.py", line 246, in __init__
2024-12-12 03:56:30.920684+00:002024-12-12 03:56:30.920503035 self.engine = self._load_engine(detector_config.model.path)
2024-12-12 03:56:30.920694+00:002024-12-12 03:56:30.920504277 File "/opt/frigate/frigate/detectors/plugins/tensorrt.py", line 90, in _load_engine
2024-12-12 03:56:30.920714+00:002024-12-12 03:56:30.920519566 with open(model_path, "rb") as f, trt.Runtime(self.trt_logger) as runtime:
2024-12-12 03:56:30.920723+00:002024-12-12 03:56:30.920525828 TypeError: expected str, bytes or os.PathLike object, not NoneType
2024-12-12 03:56:30.920732+00:002024-12-12 03:56:30.920526399 Exception ignored in: <function TensorRtDetector.__del__ at 0x7fce6115a430>
2024-12-12 03:56:30.920748+00:002024-12-12 03:56:30.920526890 Traceback (most recent call last):
2024-12-12 03:56:30.920757+00:002024-12-12 03:56:30.920527421 File "/opt/frigate/frigate/detectors/plugins/tensorrt.py", line 265, in __del__
2024-12-12 03:56:30.920767+00:002024-12-12 03:56:30.920604575 if self.outputs is not None:
2024-12-12 03:56:30.920776+00:002024-12-12 03:56:30.920610206 AttributeError: 'TensorRtDetector' object has no attribute 'outputs' Relevant go2rtc log outputN/A FFprobe output from your cameraN/A Install methodDocker Compose Object DetectorTensorRT Network connectionWired Camera make and modelhikvision 4K, amcrest 4K, reolink 1440p Screenshots of the Frigate UI's System metrics pagesAny other information that may be helpfulNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Please read the docs on configuring a tensorrt model https://docs.frigate.video/configuration/object_detectors#configuration-parameters |
Beta Was this translation helpful? Give feedback.
-
To make @NickM-27 his answer more clear,
I ran into exactly the same issue. For me this was what was missing and caused exactly your error message. So hopefully this helps you too. |
Beta Was this translation helpful? Give feedback.
To make @NickM-27 his answer more clear,
you are missing the model bit:
I ran into exactly the same issue. For me this was what was missing and caused exactly your error message. So hopefully this helps you too.