『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 236|回复: 11

[技术探讨] 关于Frigate,GPU使用才个位数,CPU还是几十,是为啥子?

[复制链接]

42

主题

504

帖子

2844

积分

金牌会员

Rank: 6Rank: 6

积分
2844
金钱
2340
HASS币
10
发表于 前天 20:01 | 显示全部楼层 |阅读模式
安装环境N5105,ESXI7.02安装Debian11,核显直通给Debian,然后Debian中docker-compose安装Frigate。
可以跑起来,也可以接入HA统计人数,就是cpu还是占用很高,GPU只用过到2-3%之类的,cpu一直是百分之几十。。。
有没有大佬给点思路,配置文件还是什么其他原因?

2024-10-16_195836.jpg
回复

使用道具 举报

42

主题

504

帖子

2844

积分

金牌会员

Rank: 6Rank: 6

积分
2844
金钱
2340
HASS币
10
 楼主| 发表于 前天 21:15 | 显示全部楼层
warning
Timestamp
2024-10-16 09:09:21
Tag
frigate.detectors
Message
CPU detectors are not recommended and should only be used for testing or for trial purposes.
警告我,又不告诉我该咋弄
回复

使用道具 举报

9

主题

219

帖子

1941

积分

论坛UI达人

积分
1941
金钱
1722
HASS币
0
发表于 前天 22:19 | 显示全部楼层
ffmpeg:
  hwaccel_args: preset-vaapi

detectors:
  ov:
    type: openvino
    device: AUTO
    model:
      path: /openvino-model/ssdlite_mobilenet_v2.xml

改为openvino探测,即可。
你这个CPU怕是要累死,要是摄像头多的话。
回复

使用道具 举报

42

主题

504

帖子

2844

积分

金牌会员

Rank: 6Rank: 6

积分
2844
金钱
2340
HASS币
10
 楼主| 发表于 前天 23:46 | 显示全部楼层
hhh. 发表于 2024-10-16 22:19
ffmpeg:
  hwaccel_args: preset-vaapi

大佬,改了配置报错了:
2024-10-16 11:44:44.527741114  [INFO] Preparing Frigate...
2024-10-16 11:44:44.546795305  [INFO] Starting Frigate...
2024-10-16 11:44:46.841765842  [2024-10-16 11:44:46] frigate.app                    INFO    : Starting Frigate (0.14.1-f4f3cfa)
2024-10-16 11:44:46.841971583  [2024-10-16 11:44:46] frigate.util.config            INFO    : Checking if frigate config needs migration...
2024-10-16 11:44:46.858128576  [2024-10-16 11:44:46] frigate.util.config            INFO    : frigate config does not need migration...
2024-10-16 11:44:47.133648676  [2024-10-16 11:44:47] frigate.util.services          INFO    : Automatically detected vaapi hwaccel for video decoding
2024-10-16 11:44:47.150957574  [2024-10-16 11:44:47] frigate.config                 WARNING : Customizing more than a detector model path is unsupported.
2024-10-16 11:44:47.165526206  [2024-10-16 11:44:47] peewee_migrate.logs            INFO    : Starting migrations
2024-10-16 11:44:47.167107244  [2024-10-16 11:44:47] peewee_migrate.logs            INFO    : There is nothing to migrate
2024-10-16 11:44:47.176794108  [2024-10-16 11:44:47] frigate.app                    INFO    : Recording process started: 380
2024-10-16 11:44:47.184745921  [2024-10-16 11:44:47] frigate.app                    INFO    : Recording process started: 381
2024-10-16 11:44:47.190666086  [2024-10-16 11:44:47] frigate.app                    INFO    : go2rtc process pid: 98
2024-10-16 11:44:47.241919229  [2024-10-16 11:44:47] detector.ov                    INFO    : Starting detection process: 409
2024-10-16 11:44:47.242624269  [2024-10-16 11:44:47] frigate.detectors.plugins.openvino WARNING : OpenVINO AUTO device type is not currently supported. Attempting to use GPU instead.
2024-10-16 11:44:47.246625597  [2024-10-16 11:44:47] frigate.app                    INFO    : Output process started: 411
2024-10-16 11:44:47.302986301  [2024-10-16 11:44:47] frigate.app                    INFO    : Camera processor started for test: 426
2024-10-16 11:44:47.325874491  [2024-10-16 11:44:47] frigate.app                    INFO    : Capture process started for test: 427
2024-10-16 11:44:56.950145175  [2024-10-16 11:44:56] frigate.detectors.plugins.openvino ERROR   : SSD model input doesn't match. Found [1,300,300,3].
2024-10-16 11:44:56.958200380  Process detector:ov:
2024-10-16 11:44:56.965081336  Traceback (most recent call last):
2024-10-16 11:44:56.965086716    File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
2024-10-16 11:44:56.965087989      self.run()
2024-10-16 11:44:56.965093608    File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
2024-10-16 11:44:56.965095408      self._target(*self._args, **self._kwargs)
2024-10-16 11:44:56.965096981    File "/opt/frigate/frigate/object_detection.py", line 125, in run_detector
2024-10-16 11:44:56.965144749      detections = object_detector.detect_raw(input_frame)
2024-10-16 11:44:56.965147362    File "/opt/frigate/frigate/object_detection.py", line 75, in detect_raw
2024-10-16 11:44:56.965148876      return self.detect_api.detect_raw(tensor_input=tensor_input)
2024-10-16 11:44:56.965150232    File "/opt/frigate/frigate/detectors/plugins/openvino.py", line 160, in detect_raw
2024-10-16 11:44:56.965196647      infer_request.infer(input_tensor)
2024-10-16 11:44:56.965198632    File "/usr/local/lib/python3.9/dist-packages/openvino/runtime/ie_api.py", line 132, in infer
2024-10-16 11:44:56.965200080      return OVDict(super().infer(_data_dispatch(
2024-10-16 11:44:56.965201384  RuntimeError: Exception from src/inference/src/cpp/infer_request.cpp:116:
2024-10-16 11:44:56.965228553  Exception from src/inference/src/cpp/infer_request.cpp:66:
2024-10-16 11:44:56.965231427  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:146:
2024-10-16 11:44:56.965233353  [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
2024-10-16 11:45:21.706279  2024-10-16 11:44:56.965234355
2024-10-16 11:45:21.706300  2024-10-16 11:44:56.965262165
2024-10-16 11:45:21.706304  2024-10-16 11:44:56.965263386
2024-10-16 11:45:00.158042767  [2024-10-16 11:45:00] ws4py                          ERROR   : Error when terminating the connection: [Errno 32] Broken pipe
2024-10-16 11:45:08.298715156  [2024-10-16 11:45:08] frigate.watchdog               INFO    : Detection appears to be stuck. Restarting detection process...
2024-10-16 11:45:08.310353617  [2024-10-16 11:45:08] detector.ov                    INFO    : Starting detection process: 622
2024-10-16 11:45:08.315650586  [2024-10-16 11:45:08] frigate.detectors.plugins.openvino WARNING : OpenVINO AUTO device type is not currently supported. Attempting to use GPU instead.
2024-10-16 11:45:18.848010905  [2024-10-16 11:45:18] frigate.detectors.plugins.openvino ERROR   : SSD model input doesn't match. Found [1,300,300,3].
2024-10-16 11:45:18.853437716  Process detector:ov:
2024-10-16 11:45:18.854788413  Traceback (most recent call last):
2024-10-16 11:45:18.855003201    File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
2024-10-16 11:45:18.855005508      self.run()
2024-10-16 11:45:18.855089645    File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
2024-10-16 11:45:18.855091612      self._target(*self._args, **self._kwargs)
2024-10-16 11:45:18.855120407    File "/opt/frigate/frigate/object_detection.py", line 125, in run_detector
2024-10-16 11:45:18.855122112      detections = object_detector.detect_raw(input_frame)
2024-10-16 11:45:18.855173980    File "/opt/frigate/frigate/object_detection.py", line 75, in detect_raw
2024-10-16 11:45:18.855175771      return self.detect_api.detect_raw(tensor_input=tensor_input)
2024-10-16 11:45:18.855269469    File "/opt/frigate/frigate/detectors/plugins/openvino.py", line 160, in detect_raw
2024-10-16 11:45:18.855271263      infer_request.infer(input_tensor)
2024-10-16 11:45:18.855300738    File "/usr/local/lib/python3.9/dist-packages/openvino/runtime/ie_api.py", line 132, in infer
2024-10-16 11:45:18.855302453      return OVDict(super().infer(_data_dispatch(
2024-10-16 11:45:18.855374273  RuntimeError: Exception from src/inference/src/cpp/infer_request.cpp:116:
2024-10-16 11:45:18.855376096  Exception from src/inference/src/cpp/infer_request.cpp:66:
2024-10-16 11:45:18.855377941  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:146:
2024-10-16 11:45:18.855379607  [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
2024-10-16 11:45:21.373840  2024-10-16 11:45:18.855380573
2024-10-16 11:45:21.373843  2024-10-16 11:45:18.855381442
2024-10-16 11:45:21.373847  2024-10-16 11:45:18.855382229
回复

使用道具 举报

42

主题

504

帖子

2844

积分

金牌会员

Rank: 6Rank: 6

积分
2844
金钱
2340
HASS币
10
 楼主| 发表于 前天 23:47 | 显示全部楼层
本帖最后由 yinghu183 于 2024-10-17 10:21 编辑
hhh. 发表于 2024-10-16 22:19
ffmpeg:
  hwaccel_args: preset-vaapi

配置贴一下供参考
version: 0.14
mqtt:
  host: 192.168.1.100
  port: 1883

detectors:
  ov:
    type: openvino
    device: AUTO
    model:
      path: /openvino-model/ssdlite_mobilenet_v2.xml
      
cameras:
  test:
    ffmpeg:
      hwaccel_args: preset-vaapi
      inputs:
        - path: rtsp://admin:[email protected]:554/h264/ch1/main/av_stream
          roles:
            - detect

    detect:
      height: 720
      width: 1280
      fps: 5

回复

使用道具 举报

11

主题

286

帖子

1540

积分

金牌会员

Rank: 6Rank: 6

积分
1540
金钱
1254
HASS币
0
发表于 昨天 09:48 | 显示全部楼层
这玩意儿我也不会搞。虽然我的配置比你垃圾N倍。是J1900的。不管怎么搞,都是CPU炸裂。我放弃了。如果只是监控,直接装个黑群晖,装个破解的套件,58个摄像头许可。
回复

使用道具 举报

9

主题

219

帖子

1941

积分

论坛UI达人

积分
1941
金钱
1722
HASS币
0
发表于 昨天 11:00 | 显示全部楼层
yinghu183 发表于 2024-10-16 23:47
配置贴一下供参考
ffmpeg:
  hwaccel_args: preset-vaapi

detectors:
  ov:
    type: openvino
    device: AUTO
    model:
      path: /openvino-model/ssdlite_mobilenet_v2.xml

model:
  width: 300
  height: 300
  input_tensor: nhwc
  input_pixel_format: bgr
  labelmap_path: /openvino-model/coco_91cl_bkgr.txt


指定模型尺寸为300*300
回复

使用道具 举报

0

主题

28

帖子

720

积分

高级会员

Rank: 4

积分
720
金钱
692
HASS币
0
发表于 昨天 11:54 | 显示全部楼层
我的不知道为啥tpu给ha,pve的内存瞬间飙升
回复

使用道具 举报

42

主题

504

帖子

2844

积分

金牌会员

Rank: 6Rank: 6

积分
2844
金钱
2340
HASS币
10
 楼主| 发表于 昨天 11:58 | 显示全部楼层
fay000fay 发表于 2024-10-17 09:48
这玩意儿我也不会搞。虽然我的配置比你垃圾N倍。是J1900的。不管怎么搞,都是CPU炸裂。我放弃了。如果只是 ...

我又参照别人的配置中调整了一下,现在可以了,两个摄像头开启检测,cpu百分之十几,基本都是20ms以内,GPU占用也上去了,再运行一段时间看稳定情况
回复

使用道具 举报

42

主题

504

帖子

2844

积分

金牌会员

Rank: 6Rank: 6

积分
2844
金钱
2340
HASS币
10
 楼主| 发表于 昨天 12:00 | 显示全部楼层
hhh. 发表于 2024-10-17 11:00
指定模型尺寸为300*300

是的,已经弄好了,就是加了个model配置就可以了 感谢!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-10-18 11:25 , Processed in 0.065463 second(s), 34 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表