blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
19.05k stars 1.74k forks source link

[Detector Support]: no such file: /openvino-model/coco_91c1_bkgr.txt #9376

Closed Strux-DK closed 8 months ago

Strux-DK commented 9 months ago

Describe the problem you are having

Just bought new cameras and was trying to get one of them to work. To do that, i had to comment out ffmpeg, detectors and model sections. I don't know why, but it kept throwing different errors until i did. Anyway, i got it working with those sections commented out, so i wanted to restore to the config i had before trying to get the camera to work, but now i can't, because apparently there is a file it can't find.

I run frigate in docker in a Proxmox LXC. The server has a i7-7700.

The only reason i put in the 'model' block is because it says so in the documentation: "Use the model configuration shown below when using the OpenVINO detector with the default model." so i did. I also tried to comment it out, but then it throws another error: "RuntimeError: The input blob size is not equal to the network input size: got 307200 expecting 270000"

As i have mentioned in previous issues i opened, i struggle with understanding all the terms, what they do and how they work together. I'm not sure what a detector or a model is or whether i need it or not, i just want hardware acceleration to work, so i can utilize my hardware as much as possible.

Version

0.12.1-367d724

Frigate config file

mqtt:
  enabled: False

go2rtc:
  streams:
    front_garden:
      - rtsp://HAFrigate:etagirFAH@192.168.1.30:554/stream1
      - "ffmpeg:back#audio=aac"
  webrtc:
    candidates:
      - 192.168.1.181:8555

ffmpeg:
  hwaccel_args: preset-intel-qsv-h264
  output_args:
    record: preset-record-generic-audio-copy

detectors:
  ov:
    type: openvino
    device: GPU
    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_91c1_bkgr.txt

cameras:
  front_garden:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/front_garden
          roles:
            - record
            - detect

I guess the rest is irrelevant

docker-compose file or Docker CLI command

version: '3.9'

services:

  frigate:
    container_name: frigate
    privileged: true
    restart: unless-stopped
    image: ghcr.io/blakeblackshear/frigate:stable
    cap_add:
      - CAP_PERFMON
    shm_size: "128mb"
    devices:
      - /dev/bus/usb:/dev/bus/usb
      - /dev/dri/renderD128
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /docker/appdata/frigate/config:/config:ro
      - /mnt/pve/media/cctv:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "5000:5000"
      - "1935:1935" # RTMP feeds
    environment:
      FRIGATE_RTSP_PASSWORD: "myPassword"

Relevant log output

*************************************************************

2024-01-18 09:07:41.773846934  *************************************************************

2024-01-18 09:07:41.773849460  ***    Your config file is not valid!                     ***

2024-01-18 09:07:41.773851166  ***    Please check the docs at                           ***

2024-01-18 09:07:41.773852281  ***    https://docs.frigate.video/configuration/index     ***

2024-01-18 09:07:41.773865880  *************************************************************

2024-01-18 09:07:41.773867075  *************************************************************

2024-01-18 09:07:41.774307059  ***    Config Validation Errors                           ***

2024-01-18 09:07:41.774308657  *************************************************************

2024-01-18 09:07:41.774309781  [Errno 2] No such file or directory: '/openvino-model/coco_91c1_bkgr.txt'

2024-01-18 09:07:41.774625154  Traceback (most recent call last):

2024-01-18 09:07:41.774627050    File "/opt/frigate/frigate/app.py", line 351, in start

2024-01-18 09:07:41.774628109      self.init_config()

2024-01-18 09:07:41.774629177    File "/opt/frigate/frigate/app.py", line 80, in init_config

2024-01-18 09:07:41.774630141      user_config = FrigateConfig.parse_file(config_file)

2024-01-18 09:07:41.774631091    File "/opt/frigate/frigate/config.py", line 1078, in parse_file

2024-01-18 09:07:41.774631983      return cls.parse_obj(config)

2024-01-18 09:07:41.774632958    File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj

2024-01-18 09:07:41.774633922    File "pydantic/main.py", line 339, in pydantic.main.BaseModel.__init__

2024-01-18 09:07:41.774635148    File "pydantic/main.py", line 1076, in pydantic.main.validate_model

2024-01-18 09:07:41.774636135    File "pydantic/fields.py", line 884, in pydantic.fields.ModelField.validate

2024-01-18 09:07:41.774658298    File "pydantic/fields.py", line 1101, in pydantic.fields.ModelField._validate_singleton

2024-01-18 09:07:41.774659488    File "pydantic/fields.py", line 1157, in pydantic.fields.ModelField._apply_validators

2024-01-18 09:07:41.774670424    File "pydantic/class_validators.py", line 337, in pydantic.class_validators._generic_validator_basic.lambda13

2024-01-18 09:07:41.774671549    File "pydantic/main.py", line 711, in pydantic.main.BaseModel.validate

2024-01-18 09:07:41.774672689    File "/opt/frigate/frigate/detectors/detector_config.py", line 65, in __init__

2024-01-18 09:07:41.774673633      **load_labels(config.get("labelmap_path", "/labelmap.txt")),

2024-01-18 09:07:41.774674602    File "/opt/frigate/frigate/util.py", line 709, in load_labels

2024-01-18 09:07:41.774675488      with open(path, "r", encoding=encoding) as f:

2024-01-18 09:07:41.774676541  FileNotFoundError: [Errno 2] No such file or directory: '/openvino-model/coco_91c1_bkgr.txt'

2024-01-18 09:07:41.774686496  

2024-01-18 09:07:41.774687600  *************************************************************

2024-01-18 09:07:41.774688566  ***    End Config Validation Errors                       ***

2024-01-18 09:07:41.774689519  *************************************************************

Operating system

Debian

Install method

Docker Compose

Coral version

CPU (no coral)

Any other information that may be helpful

No response

NickM-27 commented 9 months ago

can you get a shell in the container and see what exists at / ?

Strux-DK commented 9 months ago

billede

NickM-27 commented 9 months ago

It needs to be from within the frigate container

Strux-DK commented 9 months ago

billede

NickM-27 commented 9 months ago

Okay can you ls /openvino-model

Strux-DK commented 9 months ago

billede

Well, that makes a lot of sense

Strux-DK commented 9 months ago

Could it be a permission issue? I just migrated from HAOS add-on, so all this is a bit new to me. If so, please tell me how to proceed

GobbleTurkey commented 9 months ago

I had the same problem. The issue is around the format of the config file that is putting an extra CR character at the end of the file name. To get around it i put the model block at the end of the file so there is no more lines after. Someone could give proper fix but this worked for me.

Strux-DK commented 9 months ago

@GobbleTurkey unfortunately that did not work for me

cgils commented 9 months ago

@Strux-DK: The model filename is "coco nine one c l" (the letter L), not "coco nine one c one".

github-actions[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Jbithell commented 3 months ago

I've been getting the same issue as the above - @Strux-DK @cgils did you ever get to the bottom of what this error means?

2024-07-14 14:38:37.776116763  E: [xLinkUsb] [    317776] [frigate.detecto] usb_find_device_with_bcd:266   Library has not been initialized when loaded
2024-07-14 14:38:37.776584314  E: [xLinkUsb] [    317776] [frigate.detecto] usb_find_device_with_bcd:266   Library has not been initialized when loaded
2024-07-14 14:38:38.010492509  [2024-07-14 14:38:38] frigate.detectors.plugins.openvino INFO    : Model Input Shape: [1,300,300,3]
2024-07-14 14:38:38.010668642  [2024-07-14 14:38:38] frigate.detectors.plugins.openvino INFO    : Model Output-0 Shape: [1,1,100,7]
2024-07-14 14:38:38.010671199  [2024-07-14 14:38:38] frigate.detectors.plugins.openvino INFO    : Model has 1 Output Tensors
2024-07-14 14:38:45.730888726  Process detector:ov:
2024-07-14 14:38:45.730892171  Traceback (most recent call last):
2024-07-14 14:38:45.730893635    File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
2024-07-14 14:38:45.730894575      self.run()
2024-07-14 14:38:45.730895689    File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
2024-07-14 14:38:45.730899327      self._target(*self._args, **self._kwargs)
2024-07-14 14:38:45.730919398    File "/opt/frigate/frigate/object_detection.py", line 125, in run_detector
2024-07-14 14:38:45.730921077      detections = object_detector.detect_raw(input_frame)
2024-07-14 14:38:45.730922748    File "/opt/frigate/frigate/object_detection.py", line 75, in detect_raw
2024-07-14 14:38:45.730923864      return self.detect_api.detect_raw(tensor_input=tensor_input)
2024-07-14 14:38:45.730924934    File "/opt/frigate/frigate/detectors/plugins/openvino.py", line 84, in detect_raw
2024-07-14 14:38:45.730949273      infer_request.infer([tensor_input])
2024-07-14 14:38:45.730950724    File "/usr/local/lib/python3.9/dist-packages/openvino/runtime/ie_api.py", line 152, in infer
2024-07-14 14:38:45.730952391      return super().infer(normalize_inputs(self, dict(enumerate(inputs))))
2024-07-14 14:38:45.730953494  RuntimeError: The input blob size is not equal to the network input size: got 307200 expecting 270000