!QhvgabMQzwEQeWehhZ:lossy.network

NixOS Home Automation

503 Members
Declarative Home Automation and other Sidequests | https://wiki.nixos.org/wiki/Home_Assistant128 Servers

Load older messages


SenderMessageTime
21 Nov 2024
@hexa:lossy.network@hexa:lossy.networkhttps://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/python/interpreter.py#L13300:26:11
@hexa:lossy.network@hexa:lossy.networkhttps://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/python/interpreter.py#L8000:27:17
@hexa:lossy.network@hexa:lossy.networkLoadLibrary doesn't seem to want a path00:28:09
@netpleb:matrix.orgnetplebhmm, so somehow we have to also patch tensorflow?00:28:36
@hexa:lossy.network@hexa:lossy.networkplease no 😄 00:28:43
@netpleb:matrix.orgnetplebok, well I am officially befuddled then.00:29:30
@netpleb:matrix.orgnetpleb

here is the full error:

Nov 20 16:18:59 aleph0 frigate[5614]: [2024-11-20 16:18:59] detector.coral                 INFO    : Starting detection process: 5661
Nov 20 16:18:59 aleph0 frigate[5614]: [2024-11-20 16:18:59] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
Nov 20 16:18:59 aleph0 frigate[5661]: Process detector:coral:
Nov 20 16:18:59 aleph0 frigate[5661]: Traceback (most recent call last):
Nov 20 16:18:59 aleph0 frigate[5661]:   File "/nix/store/px2nj16i5gc3d4mnw5l1nclfdxhry61p-python3-3.12.7/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap
Nov 20 16:18:59 aleph0 frigate[5661]:     self.run()
Nov 20 16:18:59 aleph0 frigate[5661]:   File "/nix/store/px2nj16i5gc3d4mnw5l1nclfdxhry61p-python3-3.12.7/lib/python3.12/multiprocessing/process.py", line 108, in run
Nov 20 16:18:59 aleph0 frigate[5661]:     self._target(*self._args, **self._kwargs)
Nov 20 16:18:59 aleph0 frigate[5661]:   File "/nix/store/2p2ndg642zj286gjxhxl6ql1psvnmlb3-frigate-0.14.1/lib/python3.12/site-packages/frigate/object_detection.py", line 102, in run_detector
Nov 20 16:18:59 aleph0 frigate[5661]:     object_detector = LocalObjectDetector(detector_config=detector_config)
Nov 20 16:18:59 aleph0 frigate[5661]:                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 20 16:18:59 aleph0 frigate[5661]:   File "/nix/store/2p2ndg642zj286gjxhxl6ql1psvnmlb3-frigate-0.14.1/lib/python3.12/site-packages/frigate/object_detection.py", line 53, in __init__
Nov 20 16:18:59 aleph0 frigate[5661]:     self.detect_api = create_detector(detector_config)
Nov 20 16:18:59 aleph0 frigate[5661]:                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 20 16:18:59 aleph0 frigate[5661]:   File "/nix/store/2p2ndg642zj286gjxhxl6ql1psvnmlb3-frigate-0.14.1/lib/python3.12/site-packages/frigate/detectors/__init__.py", line 18, in create_detector
Nov 20 16:18:59 aleph0 frigate[5661]:     return api(detector_config)
Nov 20 16:18:59 aleph0 frigate[5661]:            ^^^^^^^^^^^^^^^^^^^^
Nov 20 16:18:59 aleph0 frigate[5661]:   File "/nix/store/2p2ndg642zj286gjxhxl6ql1psvnmlb3-frigate-0.14.1/lib/python3.12/site-packages/frigate/detectors/plugins/edgetpu_tfl.py", line 41, in __init__
Nov 20 16:18:59 aleph0 frigate[5661]:     edge_tpu_delegate = load_delegate("libedgetpu.so.1.0", device_config)
Nov 20 16:18:59 aleph0 frigate[5661]:                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 20 16:18:59 aleph0 frigate[5661]:   File "/nix/store/y7wsnapb7w8pqkifah4v7s271n30d84z-python3.12-tensorflow-2.18.0/lib/python3.12/site-packages/tensorflow/lite/python/interpreter.py", line 166, in load_delegate
Nov 20 16:18:59 aleph0 frigate[5661]:     delegate = Delegate(library, options)
Nov 20 16:18:59 aleph0 frigate[5661]:                ^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 20 16:18:59 aleph0 frigate[5661]:   File "/nix/store/y7wsnapb7w8pqkifah4v7s271n30d84z-python3.12-tensorflow-2.18.0/lib/python3.12/site-packages/tensorflow/lite/python/interpreter.py", line 73, in __init__
Nov 20 16:18:59 aleph0 frigate[5661]:     self._library = ctypes.pydll.LoadLibrary(library)
Nov 20 16:18:59 aleph0 frigate[5661]:                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 20 16:18:59 aleph0 frigate[5661]:   File "/nix/store/px2nj16i5gc3d4mnw5l1nclfdxhry61p-python3-3.12.7/lib/python3.12/ctypes/__init__.py", line 460, in LoadLibrary
Nov 20 16:18:59 aleph0 frigate[5661]:     return self._dlltype(name)
Nov 20 16:18:59 aleph0 frigate[5661]:            ^^^^^^^^^^^^^^^^^^^
Nov 20 16:18:59 aleph0 frigate[5661]:   File "/nix/store/px2nj16i5gc3d4mnw5l1nclfdxhry61p-python3-3.12.7/lib/python3.12/ctypes/__init__.py", line 379, in __init__
Nov 20 16:18:59 aleph0 frigate[5661]:     self._handle = _dlopen(self._name, mode)
Nov 20 16:18:59 aleph0 frigate[5661]:                    ^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 20 16:18:59 aleph0 frigate[5661]: OSError: libedgetpu.so.1.0: cannot open shared object file: No such file or directory
Nov 20 16:18:59 aleph0 frigate[5661]: Exception ignored in: <function Delegate.__del__ at 0x7f93e7ef0540>
Nov 20 16:18:59 aleph0 frigate[5661]: Traceback (most recent call last):
Nov 20 16:18:59 aleph0 frigate[5661]:   File "/nix/store/y7wsnapb7w8pqkifah4v7s271n30d84z-python3.12-tensorflow-2.18.0/lib/python3.12/site-packages/tensorflow/lite/python/interpreter.py", line 109, in __del__
Nov 20 16:18:59 aleph0 frigate[5661]:     if self._library is not None:
Nov 20 16:18:59 aleph0 frigate[5661]:        ^^^^^^^^^^^^^
Nov 20 16:18:59 aleph0 frigate[5661]: AttributeError: 'Delegate' object has no attribute '_library'

00:32:50
@netpleb:matrix.orgnetpleb hexa: is that error consistent with what your patch does? or did we patch the wrong thing (sorry that I do not know frigate/tensorflow/python codebase at all) 00:34:56
@hexa:lossy.network@hexa:lossy.networkplease no threads00:35:30
@hexa:lossy.network@hexa:lossy.networkthey are a usability desater00:35:35
@hexa:lossy.network@hexa:lossy.networkanyway, we're patching the calls of frigate into tensorflow00:35:50
@netpleb:matrix.orgnetpleb
In reply to @hexa:lossy.network
they are a usability desater
ok, no problem. I actually noticed the same thing. They seem terrible!
00:35:52
@hexa:lossy.network@hexa:lossy.networkthey were not intended with what we're doing to them 😄 00:36:05
@hexa:lossy.network@hexa:lossy.network
>>> ctypes.pydll.LoadLibrary("/nix/store/fvjzhbpnvdfn00ngw53nyc9qngkh5j5m-libedgetpu-0-unstable-2024-03-14/lib/libedgetpu.so.1.0")
<PyDLL '/nix/store/fvjzhbpnvdfn00ngw53nyc9qngkh5j5m-libedgetpu-0-unstable-2024-03-14/lib/libedgetpu.so.1.0', handle 22255230 at 0x7f65054765a0>
00:37:06
@hexa:lossy.network@hexa:lossy.networkthat looks pretty solid at first glance00:37:16
@hexa:lossy.network@hexa:lossy.networkuh wait00:37:50
@hexa:lossy.network@hexa:lossy.networkyour trace shows that the patch didn't get applied00:37:56
@hexa:lossy.network@hexa:lossy.network
Nov 20 16:18:59 aleph0 frigate[5661]:     edge_tpu_delegate = load_delegate("libedgetpu.so.1.0", device_config)
Nov 20 16:18:59 aleph0 frigate[5661]:                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
00:38:08
@netpleb:matrix.orgnetpleb
In reply to @hexa:lossy.network
your trace shows that the patch didn't get applied

strange.. could it be the or [ ] ++ [ ...? here is what I added to my config:

    # override the frigate package to include our patch (necessary for coral usb tpu)
    package = pkgs.frigate.overrideAttrs (oldAttrs: {
      patches = oldAttrs.patches or [ ] ++ [
        (pkgs.substituteAll {
          src = ./patches/libedgetpu.patch;
          libedgetpu = "${lib.getLib pkgs.libedgetpu}/lib/libedgetpu.so.1.0";
        })
      ];
    });
00:39:05
@hexa:lossy.network@hexa:lossy.networkit looks like this on my PR00:39:17
@hexa:lossy.network@hexa:lossy.network
41:            edge_tpu_delegate = load_delegate("/nix/store/fvjzhbpnvdfn00ngw53nyc9qngkh5j5m-libedgetpu-0-unstable-2024-03-14/lib/libedgetpu.so.1.0", device_config)
00:39:19
@hexa:lossy.network@hexa:lossy.networkwhich looks pretty solid to me00:39:26
@hexa:lossy.network@hexa:lossy.networkdid the service get restarted?00:39:57
@netpleb:matrix.orgnetpleb
In reply to @hexa:lossy.network
which looks pretty solid to me
yes, that looks solid. So somehow there is a difference between your PR and me overriding the package locally. Is it possible that the frigate package does not respect the patching process?
00:40:22
@hexa:lossy.network@hexa:lossy.networkohhhhh00:40:36
@hexa:lossy.network@hexa:lossy.networkmy bad00:40:38
@hexa:lossy.network@hexa:lossy.network instead of overrideAttrs use overridePythonAttrs 00:40:46
@netpleb:matrix.orgnetpleb
In reply to @hexa:lossy.network
instead of overrideAttrs use overridePythonAttrs
ok, updated and tried it. Still getting the same error which makes me think the patch is still not applying somehow. I also got this on my redeploy: warning: The interpretation of store paths arguments ending in .drv recently changed. If this command is now failing try again with '/nix/store/d0qg4fms4bmwmp2jz2padxpj9pycqx34-nixos-system-aleph0-25.05.20241115.5e4fbfb.drv^*'
00:44:11
@hexa:lossy.network@hexa:lossy.networkthat warning is unrelated00:44:28
@netpleb:matrix.orgnetpleb
In reply to @hexa:lossy.network
your trace shows that the patch didn't get applied
*

strange.. could it be the or [ ] ++ [ ...? here is what I added to my config:

    # override the frigate package to include our patch (necessary for coral usb tpu)
    package = pkgs.frigate.overridePythonAttrs (oldAttrs: {
      patches = oldAttrs.patches or [ ] ++ [
        (pkgs.substituteAll {
          src = ./patches/libedgetpu.patch;
          libedgetpu = "${lib.getLib pkgs.libedgetpu}/lib/libedgetpu.so.1.0";
        })
      ];
    });
00:45:11

Show newer messages


Back to Room ListRoom Version: 6