blakeblackshear / frigate

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

[Support]: Frigate fails to start, Runtime error with numpy #5236

Closed rayzorben closed 1 year ago

rayzorben commented 1 year ago

Describe the problem you are having

HA OS 9.4

Fails to start with errors around numpy

Version

Frigate (Full Access) Beta (0.12.0)

Frigate config file

mqtt:
  host: homeassistant.local
  user: ray
  password: password

ffmpeg:
  #hwaccel_args: -hwaccel vaapi -hwaccel_device /dev/dri/card0 -hwaccel_output_format yuv420p
  #hwaccel_args:
    #-hwaccel h264_rkmpp
    #-hwaccel_device /dev/dri/card0
    #-hwaccel_output_format yuv420p
  input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1

detect:
  width: 704
  height: 480
  fps: 5

snapshots:
  enabled: True

objects:
  filters:
    person:
      min_area: 800
  track:
    - car
    - person
    - dog

cameras:
  front_porch:
    motion:
      mask:
        - 0,0,0,74,70,52,173,32,274,29,416,33,530,57,653,92,704,85,704,0
    zones:
      front_street:
        coordinates: 139,39,163,31,206,36,247,23,327,25,416,34,515,51,592,72,644,89,674,97,658,172,634,163,566,138,443,112,286,76,144,86,142,66
        objects:
          - person
          - car
          - dog
      front_porch_area:
        coordinates: 0,480,0,76,140,41,140,82,258,86,430,111,652,172,704,90,704,480
        objects:
          - person
          - dog
    snapshots:
      required_zones:
        - front_street
        - front_porch_area
    ffmpeg:
      inputs:
        - path: rtsp://admin:password@192.168.1.20:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - detect
            - rtmp

  driveway:
    motion:
      mask:
        - 0,0,704,0,704,166,0,184
    ffmpeg:
      inputs:
        - path: rtsp://admin:password@192.168.1.21:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - detect
            - rtmp
    zones:
      front_street:
        coordinates: 0,250,704,239,704,170,0,181
        objects:
          - person
          - car
          - dog
      driveway_area:
        coordinates: 704,480,0,480,0,226,704,233
        objects:
          - person
          - car
          - dog
    snapshots:
      required_zones:
        - front_street
        - driveway_area

  south_side:
    motion:
      mask:
        - 0,0,0,56,38,45,114,42,345,76,629,156,704,238,704,0
    ffmpeg:
      inputs:
        - path: rtsp://admin:password@192.168.1.22:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - detect
            - rtmp

  back_north:
    motion:
      mask:
        - 626,173,630,156,629,134,543,110,449,97,316,69,171,67,78,63,0,79,0,0,704,0,704,203
    ffmpeg:
      inputs:
        - path: rtsp://admin:password@192.168.1.23:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - detect
            - rtmp

  garage:
    ffmpeg:
      inputs:
        - path: rtsp://admin:password@192.168.1.24:554/h264Preview_01_sub
          roles:
            - detect
            - rtmp

Relevant log output

s6-rc: info: service s6rc-fdholder: starting
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service s6rc-fdholder successfully started
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service log-prepare: starting
s6-rc: info: service log-prepare successfully started
s6-rc: info: service nginx-log: starting
s6-rc: info: service go2rtc-log: starting
s6-rc: info: service frigate-log: starting
s6-rc: info: service nginx-log successfully started
s6-rc: info: service go2rtc-log successfully started
s6-rc: info: service go2rtc: starting
s6-rc: info: service go2rtc successfully started
s6-rc: info: service frigate-log successfully started
s6-rc: info: service frigate: starting
[INFO] Preparing go2rtc config...
s6-rc: info: service frigate successfully started
s6-rc: info: service nginx: starting
[INFO] Starting Frigate...
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
[INFO] Starting NGINX...
s6-rc: info: service legacy-services successfully started
[WARN] Failed to get IP address from supervisor
[INFO] Starting go2rtc...
2023-01-24 20:06:39.052740843  20:06:39.051 INF go2rtc version 0.1-rc.9 linux/arm
2023-01-24 20:06:39.065172311  20:06:39.061 INF [api] listen addr=:1984
2023-01-24 20:06:39.065214602  20:06:39.062 INF [rtsp] listen addr=:8554
2023-01-24 20:06:39.065239103  20:06:39.063 INF [webrtc] listen addr=:8555
2023-01-24 20:06:39.065255436  20:06:39.064 INF [srtp] listen addr=:8443
2023-01-24 20:06:39.863981461  RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf
2023-01-24 20:06:39.864886215  Traceback (most recent call last):
2023-01-24 20:06:39.864958548    File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
2023-01-24 20:06:39.866919140      return _run_code(code, main_globals, None,
2023-01-24 20:06:39.867631684    File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
2023-01-24 20:06:39.867652393      exec(code, run_globals)
2023-01-24 20:06:39.867667851    File "/opt/frigate/frigate/__main__.py", line 9, in <module>
2023-01-24 20:06:39.869245774      from frigate.app import FrigateApp
2023-01-24 20:06:39.869988361    File "/opt/frigate/frigate/app.py", line 16, in <module>
2023-01-24 20:06:39.870009652      from frigate.comms.dispatcher import Communicator, Dispatcher
2023-01-24 20:06:39.870025986    File "/opt/frigate/frigate/comms/dispatcher.py", line 9, in <module>
2023-01-24 20:06:39.870978865      from frigate.config import FrigateConfig
2023-01-24 20:06:39.871000448    File "/opt/frigate/frigate/config.py", line 9, in <module>
2023-01-24 20:06:39.872434287      import matplotlib.pyplot as plt
2023-01-24 20:06:39.873153249    File "/usr/local/lib/python3.9/dist-packages/matplotlib/__init__.py", line 113, in <module>
2023-01-24 20:06:39.873874543      from . import _api, _version, cbook, _docstring, rcsetup
2023-01-24 20:06:39.873899043    File "/usr/local/lib/python3.9/dist-packages/matplotlib/rcsetup.py", line 27, in <module>
2023-01-24 20:06:39.874812547      from matplotlib.colors import Colormap, is_color_like
2023-01-24 20:06:39.874836464    File "/usr/local/lib/python3.9/dist-packages/matplotlib/colors.py", line 56, in <module>
2023-01-24 20:06:39.876267386      from matplotlib import _api, _cm, cbook, scale
2023-01-24 20:06:39.877000056    File "/usr/local/lib/python3.9/dist-packages/matplotlib/scale.py", line 22, in <module>
2023-01-24 20:06:39.877020764      from matplotlib.ticker import (
2023-01-24 20:06:39.877037681    File "/usr/local/lib/python3.9/dist-packages/matplotlib/ticker.py", line 138, in <module>
2023-01-24 20:06:39.878886855      from matplotlib import transforms as mtransforms
2023-01-24 20:06:39.879721900    File "/usr/local/lib/python3.9/dist-packages/matplotlib/transforms.py", line 49, in <module>
2023-01-24 20:06:39.879743776      from matplotlib._path import (
2023-01-24 20:06:39.879759526  ImportError: numpy.core.multiarray failed to import
Service Frigate exited with code 1 (by signal 0)
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service nginx: stopping
Service NGINX exited with code 0 (by signal 0)
s6-rc: info: service nginx successfully stopped
s6-rc: info: service nginx-log: stopping
s6-rc: info: service frigate: stopping
s6-rc: info: service frigate successfully stopped
s6-rc: info: service go2rtc: stopping
s6-rc: info: service frigate-log: stopping
s6-rc: info: service nginx-log successfully stopped
2023-01-24 20:06:40.253380224  exit OK
s6-rc: info: service frigate-log successfully stopped
Service go2rtc exited with code 0 (by signal 0)
s6-rc: info: service go2rtc successfully stopped
s6-rc: info: service go2rtc-log: stopping
s6-rc: info: service go2rtc-log successfully stopped
s6-rc: info: service log-prepare: stopping
s6-rc: info: service s6rc-fdholder: stopping
s6-rc: info: service log-prepare successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service s6rc-fdholder successfully stopped
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

FFprobe output from your camera

none

Frigate stats

No response

Operating system

HassOS

Install method

HassOS Addon

Coral version

CPU (no coral)

Network connection

Wired

Camera make and model

amcrest

Any other information that may be helpful

No response

NickM-27 commented 1 year ago

Please include your config. Also what hardware are you running on?

rayzorben commented 1 year ago

Added config. It was working, I updated hassos and frigate. Nothing changed in config.

I am running on Asus Tinkerboard. It has been running fine until now.

55nevets commented 1 year ago

Same issue for me. Running Armbian on Odroid HC2. Worked fine before the upgrade.

NickM-27 commented 1 year ago

Are these 32 bit OS running on these devices?

rayzorben commented 1 year ago

Yes mine is 32 bit , there is no 64 bit on Asus tinkerboard

On Tue, Jan 24, 2023, 6:48 PM Nicolas Mowen @.***> wrote:

Are these 32 bit OS running on these devices?

— Reply to this email directly, view it on GitHub https://github.com/blakeblackshear/frigate/issues/5236#issuecomment-1403023870, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3BD2TW3DUBP6S34ANQXFTWUCIBNANCNFSM6AAAAAAUFQMYYM . You are receiving this because you authored the thread.Message ID: @.***>

55nevets commented 1 year ago

yes, 32-bit OS. Armbian 22.08.8 Buster

steve@odroidhc2:~$ uname -a
Linux odroidhc2 5.4.218-odroidxu4 #22.08.6 SMP PREEMPT Tue Oct 18 06:39:15 UTC 2022 armv7l GNU/Linux
blakeblackshear commented 1 year ago

I'm not sure 32bit arm support is going to make sense for Frigate going forward. We are monitoring 32bit image downloads and so far for the latest beta it looks like ~1% of users are using 32bit arm. We already have several workarounds in place to make it build successfully, and clearly that's not even working for all users.

55nevets commented 1 year ago

fair enough. I'll transition to ARM64.

rayzorben commented 1 year ago

Not sure i'd say it is fair to ask everyone to go out and buy a new 64 bit device that is either ot of stock or ridiculously overpriced in today's market. If the rpi4b was still the $50 it was back in 2019 it would be a no brainer, but $150 just for the device, or $250 for a full kit is crazy. There are Intel NUCs on the market with 8GB/256GB SSD for $250.

NickM-27 commented 1 year ago

Not sure i'd say it is fair to ask everyone to go out and buy a new 64 bit device that is either ot of stock or ridiculously overpriced in today's market. If the rpi4b was still the $50 it was back in 2019 it would be a no brainer, but $150 just for the device, or $250 for a full kit is crazy. There are Intel NUCs on the market with 8GB/256GB SSD for $250.

No one is saying a new device needs to be purchased. Frigate continues to work today on 32bit as is. The deprecation of 32 bit OS has been going on for many many years across software space in general, I don't think it should come as a surprise. Even Android has stopped supporting all 32 bit apps in its latest OS versions.

rayzorben commented 1 year ago

Not sure i'd say it is fair to ask everyone to go out and buy a new 64 bit device that is either ot of stock or ridiculously overpriced in today's market. If the rpi4b was still the $50 it was back in 2019 it would be a no brainer, but $150 just for the device, or $250 for a full kit is crazy. There are Intel NUCs on the market with 8GB/256GB SSD for $250.

No one is saying a new device needs to be purchased. Frigate continues to work today on 32bit as is. The deprecation of 32 bit OS has been going on for many many years across software space in general, I don't think it should come as a surprise. Even Android has stopped supporting all 32 bit apps in its latest OS versions.

Sure, but at some point, you are saying that Frigate will stop working on 32 bit and thus, will not be updated on 32 bit systems such as mine. Which is fine, 11.0 continues to work, but at some point there will be a bug, or a feature that will not work which if I really care about will require me to purchase new hardware.

As a part time developer who puts out free projects myself, I get that it becomes more complex to support every scenario / hardware combination, nor do I expect you to. Although I know Frigate is it's own stand alone product, a large component and upsell of it is the HA integration. It would be nice if you could commit to supporting whatever hardware systems home assistant officially supports, and if HA drops support then Frigate should to.

NickM-27 commented 1 year ago

It would be nice if you could commit to supporting whatever hardware systems home assistant officially supports, and if HA drops support then Frigate should to.

To be clear I'm speaking my own opinion and not for the frigate project in any way.

Personally, I see no relevance to what HA does. HA has a much larger user base, has an analogous company which employs people to work on it, and is an entirely different project.

You can also see via the HA analytics that the 32 bit user base, while still small, is considerably larger than frigate's which is ~1% of users.

rayzorben commented 1 year ago

It would be nice if you could commit to supporting whatever hardware systems home assistant officially supports, and if HA drops support then Frigate should to.

To be clear I'm speaking my own opinion and not for the frigate project in any way.

Personally, I see no relevance to what HA does. HA has a much larger user base, has an analogous company which employs people to work on it, and is an entirely different project.

You can also see via the HA analytics that the 32 bit user base, while still small, is considerably larger than frigate's which is ~1% of users.

I definitely value your opinion. Out of curiosity, what is the hurdle to supporting 32 bit? Is it lack of systems for testing, downstream packages, something to do with ffmpeg, etc.?

Also out of curiosity what does 1% mean. 1% of a million is still 10,000 :) Are only direct downloads counted? What about those like me who install HA and use it as an addon (I know it pulls a container for this).

NickM-27 commented 1 year ago

It's python dependencies like numpy, they're just much more difficult to work with on 32bit. Ffmpeg has also given some trouble in the past.

Also out of curiosity what does 1% mean. 1% of a million is still 10,000 :) Are only direct downloads counted? What about those like me who install HA and use it as an addon (I know it pulls a container for this).

You can look at the frigate package on the this repo and see the numbers for the beta container. Right now ~1% = ~15 users.

And yes, that does count addon users.

rayzorben commented 1 year ago

Thanks! Would be nice to see support for 0.12 but I guess I will figure out a way to transition within the next 6 months, so it would be nice to buy some time on that.

github-actions[bot] commented 1 year 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.

kzgrey commented 1 year ago

Are you sure this has anything to do with 64bit arch? I'm running on a Raspberry Pi Model 4 running 64bit image and I get this same issue with numpy:

pi@raspberrypi:~/Frigate $ uname -a
Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux

My config.yml file is blank with no cameras or mqtt settings.

NickM-27 commented 1 year ago

Users running 32 bit OS as well as users with outdated docker installs have seen this issue. We are very sure at this point it is related to that.

kzgrey commented 1 year ago

Is it the Docker install or the docker containers? I installed Docker on the 2/2023 Raspbian 64 bit build using the following command and hit this problem while trying to start Frigate:

curl -fsSL test.docker.com -o get-docker.sh && sh get-docker.sh

I was following the steps in this doc: https://dev.to/elalemanyo/how-to-install-docker-and-docker-compose-on-raspberry-pi-1mo

Background for me is that I have my setup working on HassOS but it is super flakey. A lot of the Frigate docs say to use docker-compose, so I'm trying to start over on a Raspi4 8GB and solely dedicate it to running Frigate (so no Home Assistant instance).

NickM-27 commented 1 year ago

Is it the Docker install or the docker containers?

It is the docker install, check your docker version docker --version

esistgut commented 1 year ago

I get the same error on Docker 24.0.2 on a 64bit raspbian

root@pi4:~# docker --version
Docker version 24.0.2, build cb74dfc
root@pi4:~# uname -a
Linux pi4 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux
mrthemask commented 1 year ago

I get the same error on Docker 24.0.2 on a 64bit raspbian

root@pi4:~# docker --version
Docker version 24.0.2, build cb74dfc
root@pi4:~# uname -a
 Linux pi4 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux
NickM-27 commented 1 year ago

Don't trust uname, another user had uname saying aarch64 and the OS was not actually 64 bit https://github.com/blakeblackshear/frigate/issues/6454#issuecomment-1621888628