rhasspy / wyoming-openwakeword

Wyoming protocol server for openWakeWord wake word detection system
MIT License
83 stars 23 forks source link

Numpy v2 causing breaking change to wyoming-openwakeword #26

Closed famgala closed 4 days ago

famgala commented 1 week ago

The project is compiled with Numpy v1. Very recently the numpy project, for the first time since 2006, iirc, has released a major version update. Numpy v2 is what is now installed by default, causing a critical error and the app not to start.

The project should compile with Numpy v2 to resolve, or update requirements.txt to set numpy==1.26.0

famgala commented 1 week ago

https://numpy.org/devdocs/release/2.0.0-notes.html

CamSoper commented 1 week ago

I'm having the same issue. Here's the log dump. I'm using this procedure to set it up.

Jun 26 12:27:27 wyoming run[3545]: DEBUG:wyoming_openwakeword.handler:Client connected: 2841141992220
Jun 26 12:27:27 wyoming run[3545]: DEBUG:root:Loading hey_jarvis_v0.1 from /home/pi/wyoming-satellite/local/wyoming-openwakeword/wyoming_openwakeword/models/hey_jarvis_v0.1.tflite
Jun 26 12:27:27 wyoming run[3545]: DEBUG:wyoming_openwakeword.handler:Started thread for hey_jarvis_v0.1
Jun 26 12:27:27 wyoming run[3545]: A module that was compiled using NumPy 1.x cannot be run in
Jun 26 12:27:27 wyoming run[3545]: NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
Jun 26 12:27:27 wyoming run[3545]: versions of NumPy, modules must be compiled with NumPy 2.0.
Jun 26 12:27:27 wyoming run[3545]: Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.
Jun 26 12:27:27 wyoming run[3545]: If you are a user of the module, the easiest solution will be to
Jun 26 12:27:27 wyoming run[3545]: downgrade to 'numpy<2' or try to upgrade the affected module.
Jun 26 12:27:27 wyoming run[3545]: We expect that some modules will need time to support NumPy 2.
Jun 26 12:27:27 wyoming run[3545]: Traceback (most recent call last):  File "/usr/lib/python3.11/threading.py", line 995, in _bootstrap
Jun 26 12:27:27 wyoming run[3545]:     self._bootstrap_inner()
Jun 26 12:27:27 wyoming run[3545]:   File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
Jun 26 12:27:27 wyoming run[3545]:     self.run()
Jun 26 12:27:27 wyoming run[3545]:   File "/usr/lib/python3.11/threading.py", line 975, in run
Jun 26 12:27:27 wyoming run[3545]:     self._target(*self._args, **self._kwargs)
Jun 26 12:27:27 wyoming run[3545]:   File "/home/pi/wyoming-satellite/local/wyoming-openwakeword/wyoming_openwakeword/openwakeword.py", line 248, in ww_proc
Jun 26 12:27:27 wyoming run[3545]:     ww_model = tflite.Interpreter(model_path=str(ww_model_path), num_threads=1)
Jun 26 12:27:27 wyoming run[3545]:   File "/home/pi/wyoming-satellite/local/wyoming-openwakeword/.venv/lib/python3.11/site-packages/tflite_runtime/interpreter.py", line 473, in __init__
Jun 26 12:27:27 wyoming run[3545]:     self._interpreter = _interpreter_wrapper.CreateWrapperFromFile(
Jun 26 12:27:27 wyoming run[3545]: AttributeError: _ARRAY_API not found
Jun 26 12:27:27 wyoming run[3545]: ERROR:root:Unexpected error in wake word thread (hey_jarvis_v0.1)
Jun 26 12:27:27 wyoming run[3545]: ImportError: numpy.core.multiarray failed to import
Jun 26 12:27:27 wyoming run[3545]: The above exception was the direct cause of the following exception:
Jun 26 12:27:27 wyoming run[3545]: Traceback (most recent call last):
Jun 26 12:27:27 wyoming run[3545]:   File "/home/pi/wyoming-satellite/local/wyoming-openwakeword/wyoming_openwakeword/openwakeword.py", line 248, in ww_proc
Jun 26 12:27:27 wyoming run[3545]:     ww_model = tflite.Interpreter(model_path=str(ww_model_path), num_threads=1)
Jun 26 12:27:27 wyoming run[3545]:                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jun 26 12:27:27 wyoming run[3545]:   File "/home/pi/wyoming-satellite/local/wyoming-openwakeword/.venv/lib/python3.11/site-packages/tflite_runtime/interpreter.py", line 473, in __init__
Jun 26 12:27:27 wyoming run[3545]:     self._interpreter = _interpreter_wrapper.CreateWrapperFromFile(
Jun 26 12:27:27 wyoming run[3545]:                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jun 26 12:27:27 wyoming run[3545]: SystemError: <built-in method CreateWrapperFromFile of PyCapsule object at 0x7f92b82bb0> returned a result with an exception set
CamSoper commented 4 days ago

This was fixed by https://github.com/rhasspy/wyoming-openwakeword/pull/25 and can be closed