[Detector Support]: [GPU] The tensor size is not equal to model #15771
-
Describe the problem you are havingI'm getting below error when using OV detector [GPU] The tensor size is not equal to model, can't set input tensor with index: 0, because model input (shape=[1,300,300,3]) and tensor (shape=[1,320,320,3]) are incompatible I need to understand from where shape=1,320,320,3 coming from, which process is responsible for it. Version0.15-beta4 Frigate config filemqtt:
host: core-mosquitto
user: mqttuser
password: mqttuser
topic_prefix: frigate
client_id: frigate
stats_interval: 60
enabled: true
database:
path: /config/frigate.db
detectors:
ov:
type: openvino
device: GPU
model:
width: 300
height: 300
input_tensor: nhwc
input_pixel_format: bgr
path: /openvino-model/ssdlite_mobilenet_v2.xml
labelmap_path: /openvino-model/coco_91cl_bkgr.txt
ffmpeg:
hwaccel_args: preset-vaapi
output_args:
record: preset-record-generic-audio-copy
go2rtc:
streams:
camera-1:
- rtsp://
doorbell:
- rtsp://
cameras:
camera-1:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/camera-1
roles:
- record
- detect
- audio
detect:
fps: 5
objects:
track:
- person
- car
- motorcycle
- bicycle
- truck
- dog
- cat
- cycle
filters:
person:
min_area: 800
max_area: 25000
threshold: 0.6
car:
min_area: 800
max_area: 20000
threshold: 0.65
motorcycle:
min_area: 500
max_area: 18000
threshold: 0.6
bicycle:
min_area: 400
max_area: 15000
threshold: 0.6
truck:
min_area: 1000
max_area: 30000
threshold: 0.65
dog:
min_area: 300
max_area: 12000
threshold: 0.6
cat:
min_area: 200
max_area: 10000
threshold: 0.6
cycle:
min_area: 400
max_area: 15000
threshold: 0.6
record:
enabled: true
retain:
days: 14
mode: motion
alerts:
retain:
days: 60
pre_capture: 15
post_capture: 20
detections:
retain:
days: 30
snapshots:
enabled: true
timestamp: true
bounding_box: true
retain:
default: 90
motion:
threshold: 43
contour_area: 35
improve_contrast: true
mask:
- 0.995,0,0.723,0,0.73,0.039,0.747,0.147,0.755,0.191,0.765,0.269,0.761,0.33,0.771,0.388,0.793,0.472,0.805,0.513,0.803,0.555,0.804,0.593,0.814,0.634,0.867,0.678,0.905,0.702,0.997,0.726
- 0,0.002,0.261,0,0.255,0.191,0,0.29
- 0.717,0,0.748,0.148,0.253,0.184,0.264,0
zones:
kia:
coordinates:
0.636,0.372,0.633,0.331,0.623,0.297,0.613,0.281,0.6,0.273,0.58,0.27,0.565,0.275,0.552,0.295,0.547,0.31,0.546,0.345,0.548,0.379,0.567,0.395,0.595,0.406,0.628,0.404
inertia: 3
loitering_time: 0
face:
coordinates:
0,0.322,0.1,0.312,0.394,0.382,0.647,0.41,0.781,0.472,0.817,0.993,0.005,0.994,0.002,0.413
inertia: 3
loitering_time: 0
objects: person
audio:
enabled: true
review:
detections: {}
alerts:
required_zones: kia
doorbell:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/doorbell
roles:
- detect
- record
- audio
detect:
fps: 5
objects:
track:
- person
- cat
- dog
filters:
person:
threshold: 0.6
cat:
threshold: 0.6
dog:
threshold: 0.6
record:
enabled: true
retain:
days: 14
mode: motion
alerts:
retain:
days: 60
pre_capture: 15
post_capture: 25
detections:
retain:
days: 30
snapshots:
enabled: true
timestamp: true
bounding_box: true
retain:
default: 90
motion:
threshold: 30
contour_area: 10
improve_contrast: true
mask:
- 0.629,0,0.138,0,0.015,0,0.184,0.328,0.345,0.27
zones:
door:
coordinates: 1,0,0.634,0.002,0.57,0.571,0.569,0.869,0.528,0.923,0.522,0.997,0.989,0.984
inertia: 3
loitering_time: 0
objects:
- person
audio:
enabled: true
review:
detections: {}
alerts:
required_zones: door
semantic_search:
enabled: true
reindex: false
model_size: large
version: 0.15-0 docker-compose file or Docker CLI commandadd on on homeassistant Relevant Frigate log output2025-01-02 05:32:19.556433110 [2025-01-02 07:32:19] frigate.detectors.plugins.openvino ERROR : SSD model input doesn't match. Found [1,300,300,3].
2025-01-02 05:32:19.559389778 Process detector:ov:
2025-01-02 05:32:19.559393568 Traceback (most recent call last):
2025-01-02 05:32:19.559395017 File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
2025-01-02 05:32:19.559395943 self.run()
2025-01-02 05:32:19.559397064 File "/opt/frigate/frigate/util/process.py", line 41, in run_wrapper
2025-01-02 05:32:19.559397941 return run(*args, **kwargs)
2025-01-02 05:32:19.559398942 File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
2025-01-02 05:32:19.559399849 self._target(*self._args, **self._kwargs)
2025-01-02 05:32:19.559400881 File "/opt/frigate/frigate/object_detection.py", line 145, in run_detector
2025-01-02 05:32:19.559401783 detections = object_detector.detect_raw(input_frame)
2025-01-02 05:32:19.559402766 File "/opt/frigate/frigate/object_detection.py", line 95, in detect_raw
2025-01-02 05:32:19.559403663 return self.detect_api.detect_raw(tensor_input=tensor_input)
2025-01-02 05:32:19.559404740 File "/opt/frigate/frigate/detectors/plugins/openvino.py", line 157, in detect_raw
2025-01-02 05:32:19.559405632 infer_request.infer(input_tensor)
2025-01-02 05:32:19.559406691 File "/usr/local/lib/python3.9/dist-packages/openvino/runtime/ie_api.py", line 132, in infer
2025-01-02 05:32:19.559407529 return OVDict(super().infer(_data_dispatch(
2025-01-02 05:32:19.559408459 RuntimeError: Exception from src/inference/src/cpp/infer_request.cpp:116:
2025-01-02 05:32:19.559409314 Exception from src/inference/src/cpp/infer_request.cpp:66:
2025-01-02 05:32:19.559410824 Check 'shape.compatible(ov::PartialShape(tensor->get_shape())) || tensor->get_shape() == ov::Shape {0} || port.get_partial_shape().is_dynamic()' failed at src/plugins/intel_gpu/src/plugin/sync_infer_request.cpp:144:
2025-01-02 05:32:19.559412212 [GPU] The tensor size is not equal to model, can't set input tensor with index: 0, because model input (shape=[1,300,300,3]) and tensor (shape=[1,320,320,3]) are incompatible Install methodHassOS Addon Object DetectorOpenVino Screenshots of the Frigate UI's System metrics pagesNone Any other information that may be helpfulNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
In your config.yaml your 'model' entry is indented. This might just be an issue with copying and pasting the text but it should be non-indented. Check the frigate docs on object detectors for an example. |
Beta Was this translation helpful? Give feedback.
The original answer is correct, your config is wrong because model should be its own property not a property of detector.
If you've already changed this you need to show your config