Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openwakeword installation failing on RPi Zero 2 64bit with Respeaker 2 Mic hat #157

Open
c-sattler opened this issue Apr 19, 2024 · 29 comments

Comments

@c-sattler
Copy link

I have Wyoming satellite successfully installed on one RPi Zero2 running 64bit lite RPi OS with Respeaker 2 Mic hat, but when following the same tutorial to install it on a second set it is now failing while running the script to get the tflite-runtime-nightly.

cd ~/wyoming-openwakeword
script/setup
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: pip in ./.venv/lib/python3.9/site-packages (24.0)
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: setuptools in ./.venv/lib/python3.9/site-packages (69.5.1)
Requirement already satisfied: wheel in ./.venv/lib/python3.9/site-packages (0.43.0)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))': /simple/wheel/
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
ERROR: Could not find a version that satisfies the requirement tflite-runtime-nightly (from versions: none)
ERROR: No matching distribution found for tflite-runtime-nightly
Traceback (most recent call last):
File "/home/bedroomsatellite/wyoming-openwakeword/script/setup", line 26, in
subprocess.check_call(pip + ["install", "-r", str(_PROGRAM_DIR / "requirements.txt")])
File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/bedroomsatellite/wyoming-openwakeword/.venv/bin/python3', '-m', 'pip', 'install', '-r', '/home/bedroomsatellite/wyoming-openwakeword/requirements.txt']' returned non-zero exit status 1.

It's not finding tflite-runtime-nightly is the provided indexes.
I've tried this on both 4/18/24 and 4/19/24 in case there was an issue with the nightly rebuild of tflite-runtime-nightly, failed both days.

@Mabe75
Copy link

Mabe75 commented Apr 19, 2024

Same here! My first install 3 days ago went fine. Today I got the same error as mentioned above.

@CrystalCake
Copy link

same probleme here.
Newly setup pi zero 2 64bit OS installed.

@Dza-byte
Copy link

me as well
pi 3b and 4 mic hat.

@indoorwolf
Copy link

i have the same problem with a zero 2 w 64bit lite

@kdutton1964
Copy link

kdutton1964 commented Apr 20, 2024

In openwakeword requirements.txt I changed...

tflite-runtime-nightly
wyoming==1.5.3

to

tflite-runtime
wyoming==1.5.3

*deleting -nightly part
This worked for me, I also performed a successful install few days ago. Went back to do fresh install and it failed.

@don86nl
Copy link

don86nl commented Apr 22, 2024

In openwakeword requirements.txt I changed... tflite-runtime-nightly wyoming==1.5.3

to

tflite-runtime wyoming==1.5.3 deleting -nightly

This worked for me, I also performed a successful install few days ago. Went back to do fresh install and it failed.

Thanks @kdutton1964 , this worked for me. To others who blindly copied the lines like me, including 'deleting -nightly' 😂, the lines in the file should be:

tflite-runtime
wyoming==1.5.3

@c-sattler
Copy link
Author

c-sattler commented Apr 22, 2024 via email

@j5bart
Copy link

j5bart commented Apr 29, 2024

Had the same issue, opened a PR in wyoming-openwakword project to hopefully have above resolved going forward.

@jeremyfa55
Copy link

jeremyfa55 commented May 8, 2024

Hello,

I did the modification, but i still got the error :

 script/setup
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: pip in ./.venv/lib/python3.11/site-packages (24.0)
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: setuptools in ./.venv/lib/python3.11/site-packages (69.5.1)
Requirement already satisfied: wheel in ./.venv/lib/python3.11/site-packages (0.43.0)
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
ERROR: Could not find a version that satisfies the requirement tflite-runtime (from versions: none)
ERROR: No matching distribution found for tflite-runtime
Traceback (most recent call last):
  File "/home/jeremy/wyoming-openwakeword/script/setup", line 26, in <module>
    subprocess.check_call(pip + ["install", "-r", str(_PROGRAM_DIR / "requirements.txt")])
  File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/jeremy/wyoming-openwakeword/.venv/bin/python3', '-m', 'pip', 'install', '-r', '/home/jeremy/wyoming-openwakeword/requirements.txt']' returned non-zero exit status 1.

@tannisroot
Copy link
Contributor

It seems that this is caused by tflite-runtime dropping support for Bullseye, as the package requires a newer glibc version.

@niet16
Copy link

niet16 commented May 17, 2024

I am experiencing the same error. I couldn't get the open wakeword service to function properly after the adjustment proposed earlier.

@strusic
Copy link

strusic commented May 19, 2024

I have same issue. After deleting -nightly part I ran script and it installs but when I prompt
sudo systemctl status wyoming-satellite.service wyoming-openwakeword.service
I have wyoming-satellite.service as active but wyoming-openwakeword.service is inactive (dead)

EDIT:
Okay so I managed to do this. I manually start service by:
sudo systemctl enable --now wyoming-openwakeword.service
and now both are working even after reboot

@tannisroot
Copy link
Contributor

I've found that the non-nightly version seems to occasionally crash.
This can probably be workarounded with a change to the service to restart it when it dies, but I think a proper solution here is to switch to bookworm based Pi OS for which there is a wheel for -nightly.
I've been running my satellite on non-legacy Pi OS Lite and it works fine, just needed to install the respeaker driver for the 6.6 branch.

@boehmr77
Copy link

I've found that the non-nightly version seems to occasionally crash. This can probably be workarounded with a change to the service to restart it when it dies, but I think a proper solution here is to switch to bookworm based Pi OS for which there is a wheel for -nightly. I've been running my satellite on non-legacy Pi OS Lite and it works fine, just needed to install the respeaker driver for the 6.6 branch.

Can you explain a bit more in detail how you installed the repseaker driver for the 6.6 branch? I'm having the same problem, but don't quite understand. Thanks.

@tannisroot
Copy link
Contributor

tannisroot commented May 28, 2024

I've found that the non-nightly version seems to occasionally crash. This can probably be workarounded with a change to the service to restart it when it dies, but I think a proper solution here is to switch to bookworm based Pi OS for which there is a wheel for -nightly. I've been running my satellite on non-legacy Pi OS Lite and it works fine, just needed to install the respeaker driver for the 6.6 branch.

Can you explain a bit more in detail how you installed the repseaker driver for the 6.6 branch? I'm having the same problem, but don't quite understand. Thanks.

Well first you need to have a Pi OS version (latest non-legacy) that ships with 6.6 kernel, and then you just follow the guide for 2mic as before. I PR-ed a change (which is merged) to the driver installation script that allows to install the driver on any supported kernel, so it should select the branch for 6.6 automatically without any intervention. Just make sure the local repo is up-to-date (so git pull origin master).
I should note that I only tested it with 2-Mic and not with 4 Mic board.

@tannisroot
Copy link
Contributor

I've found that the non-nightly version seems to occasionally crash. This can probably be workarounded with a change to the service to restart it when it dies, but I think a proper solution here is to switch to bookworm based Pi OS for which there is a wheel for -nightly. I've been running my satellite on non-legacy Pi OS Lite and it works fine, just needed to install the respeaker driver for the 6.6 branch.

Can you explain a bit more in detail how you installed the repseaker driver for the 6.6 branch? I'm having the same problem, but don't quite understand. Thanks.

In case you need further help I would be happy to assist in Home Assistant discord server in #voice_assistants channel, my @ nickname is the same as here but the pfp is an owl figurine

@boehmr77
Copy link

Thanks, I finally got everything running this morning. I used the Sker65 fork of rhasspy with your latest commit from last week. I think the real issue is cloning from the wyoming-openwakeword repository. Currently is you're using the Pi OS 64 Legacy Lite it has an issue with the tflite-nightly in the requirements.txt. Removing the nightly and re-running the script seemed to work this time. Although now I'm not able to get the LED service to work. Journal shows it's running but the Pi Hat LEDs don't work.

@tannisroot
Copy link
Contributor

tannisroot commented May 28, 2024

Thanks, I finally got everything running this morning. I used the Sker65 fork of rhasspy with your latest commit from last week. I think the real issue is cloning from the wyoming-openwakeword repository. Currently is you're using the Pi OS 64 Legacy Lite it has an issue with the tflite-nightly in the requirements.txt. Removing the nightly and re-running the script seemed to work this time. Although now I'm not able to get the LED service to work. Journal shows it's running but the Pi Hat LEDs don't work.

FYI I had bad luck with the non-nightly version of tflite, the openwakeword service would just crash after some time and not restart, bookworm non-legacy Pi OS Lite is so far a lot more stable for me.

@tonyis49
Copy link

Hi all,
I am also having the same problem installing the openwakeword. I removed the -nightly from the requirements.txt as suggested and al least the install completed successfully. however I now have the following error:
AttributeError: _ARRAY_API not found
Jun 19 16:27:16 jarvis2 run[471]: ERROR:root:Unexpected error in wake word thread (hey_jarvis_v0.1)
Jun 19 16:27:16 jarvis2 run[471]: ImportError: numpy.core.multiarray failed to import
Jun 19 16:27:16 jarvis2 run[471]: The above exception was the direct cause of the following exception:
Jun 19 16:27:16 jarvis2 run[471]: Traceback (most recent call last):
Jun 19 16:27:16 jarvis2 run[471]: File "/home/tony/wyoming-openwakeword/wyoming_openwakeword/openwakeword.py", line 248, in ww_proc
Jun 19 16:27:16 jarvis2 run[471]: ww_model = tflite.Interpreter(model_path=str(ww_model_path), num_threads=1)
Jun 19 16:27:16 jarvis2 run[471]: File "/home/tony/wyoming-openwakeword/.venv/lib/python3.9/site-packages/tflite_runtime/interpreter.py", line 464, in init
Jun 19 16:27:16 jarvis2 run[471]: self._interpreter = _interpreter_wrapper.CreateWrapperFromFile(
Jun 19 16:27:16 jarvis2 run[471]: SystemError: <built-in method CreateWrapperFromFile of PyCapsule object at 0x7f963389c0> returned a result with an error set

any help would be be gratefully appreciated

@Shpyda
Copy link

Shpyda commented Jun 20, 2024

I've found that the non-nightly version seems to occasionally crash. This can probably be workarounded with a change to the service to restart it when it dies, but I think a proper solution here is to switch to bookworm based Pi OS for which there is a wheel for -nightly. I've been running my satellite on non-legacy Pi OS Lite and it works fine, just needed to install the respeaker driver for the 6.6 branch.

I switched to Bookworm and followed the tutorial but am continuously getting the following error for the OpenWakeWord service. How were you able to get around this?:

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

@P4uLT
Copy link

P4uLT commented Jun 20, 2024

Hi.

I managed to get it to start

Fix is here : DeepLabCut/DeepLabCut#2624 (comment)

I ran this command .venv/bin/pip3 install "numpy<2"


● wyoming-openwakeword.service - Wyoming openWakeWord
     Loaded: loaded (/etc/systemd/system/wyoming-openwakeword.service; disabled; vendor preset: enabled)
     Active: active (running) since Thu 2024-06-20 22:45:12 UTC; 2s ago
   Main PID: 2318 (python3)
      Tasks: 7 (limit: 191)
        CPU: 2.059s
     CGroup: /system.slice/wyoming-openwakeword.service
             ├─2318 python3 /home/pi/wyoming-openwakeword/script/run --uri tcp://127.0.0.1:10400
             └─2321 /home/p4ult/wyoming-openwakeword/.venv/bin/python3 -m wyoming_openwakeword --uri tcp://127.0.0.1:10400

Jun 20 22:45:12 jarvis systemd[1]: Started Wyoming openWakeWord.
Jun 20 22:45:14 jarvis run[2321]: INFO:root:Ready

@Scrazzled
Copy link

Hi.

I managed to get it to start

Fix is here : DeepLabCut/DeepLabCut#2624 (comment)

I ran this command .venv/bin/pip3 install "numpy<2"


● wyoming-openwakeword.service - Wyoming openWakeWord
     Loaded: loaded (/etc/systemd/system/wyoming-openwakeword.service; disabled; vendor preset: enabled)
     Active: active (running) since Thu 2024-06-20 22:45:12 UTC; 2s ago
   Main PID: 2318 (python3)
      Tasks: 7 (limit: 191)
        CPU: 2.059s
     CGroup: /system.slice/wyoming-openwakeword.service
             ├─2318 python3 /home/pi/wyoming-openwakeword/script/run --uri tcp://127.0.0.1:10400
             └─2321 /home/p4ult/wyoming-openwakeword/.venv/bin/python3 -m wyoming_openwakeword --uri tcp://127.0.0.1:10400

Jun 20 22:45:12 jarvis systemd[1]: Started Wyoming openWakeWord.
Jun 20 22:45:14 jarvis run[2321]: INFO:root:Ready

I did the same and it didn't resolve the error for me.

@dazemc
Copy link

dazemc commented Jun 23, 2024

I did the same and it didn't resolve the error for me.

It depends on which distro you are on. There is no nightly build compatible on bullseye so you will need to remove it, with bookworm it's just numpy, requirements.txt for bullseye should be;

tflite-runtime
wyoming==1.5.3
numpy<2

@Scrazzled
Copy link

It depends on which distro you are on. There is no nightly build compatible on bullseye so you will need to remove it, with bookworm it's just numpy, requirements.txt for bullseye should be;

tflite-runtime wyoming==1.5.3 numpy<2

Thanks, I'll try again later when I've replaced my hat... mine stopped communicating with the Pi so I wiped the sd and started working on a different project. I'm unsure what caused the hardware failure.

@owingst
Copy link

owingst commented Jun 23, 2024

@dazemc

Still no luck with wyoming-openwakeword. Running on Raspberry Pi zero 2 W. I installed Raspberry Pi OS (Legacy, 64 bit) Lite. Successfully installed numpy-2.0.0 tflite-runtime-2.13.0.

If the issue is Numpy, do I need to down grade to 1.19.5 or so? I noticed you mentioned Numpy<2....

wyoming-satellite runs with no issues.

pi@pi0:~ $ hostnamectl
Static hostname: pi0
Icon name: computer
Machine ID: a24ead6923d842aebe9a6586904f1157
Boot ID: 3c918fe125e24df5baa7443d98d1f582
Operating System: Debian GNU/Linux 11 (bullseye)
Kernel: Linux 6.1.21-v8+
Architecture: arm64

wyoming-openwakeword.service - Wyoming openWakeWord
Loaded: loaded (/etc/systemd/system/wyoming-openwakeword.service; disabled; vendor preset: enabled)
Active: active (running) since Sun 2024-06-23 14:39:12 CDT; 21s ago
Main PID: 1107 (python3)
Tasks: 5 (limit: 191)
CPU: 2.698s
CGroup: /system.slice/wyoming-openwakeword.service
├─1107 python3 /home/pi/wyoming-openwakeword/script/run --uri tcp://127.0.0.1:10400
└─1109 /home/pi/wyoming-openwakeword/.venv/bin/python3 -m wyoming_openwakeword --uri tcp://127.0.0.1:10400

Jun 23 14:39:15 pi0 run[1109]: AttributeError: _ARRAY_API not found
Jun 23 14:39:15 pi0 run[1109]: ERROR:root:Unexpected error in wake word thread (alexa_v0.1)
Jun 23 14:39:15 pi0 run[1109]: ImportError: numpy.core.multiarray failed to import
Jun 23 14:39:15 pi0 run[1109]: The above exception was the direct cause of the following exception:
Jun 23 14:39:15 pi0 run[1109]: Traceback (most recent call last):
Jun 23 14:39:15 pi0 run[1109]: File "/home/pi/wyoming-openwakeword/wyoming_openwakeword/openwakeword.py", line 248, in ww_proc
Jun 23 14:39:15 pi0 run[1109]: ww_model = tflite.Interpreter(model_path=str(ww_model_path), num_threads=1)
Jun 23 14:39:15 pi0 run[1109]: File "/home/pi/wyoming-openwakeword/.venv/lib/python3.9/site-packages/tflite_runtime/interpreter.py", line 464, in init
Jun 23 14:39:15 pi0 run[1109]: self._interpreter = _interpreter_wrapper.CreateWrapperFromFile(
Jun 23 14:39:15 pi0 run[1109]: SystemError: <built-in method CreateWrapperFromFile of PyCapsule object at 0x7f901a3270> returned a result with an error set

@tannisroot
Copy link
Contributor

Still no luck with wyoming-openwakeword. Running on Raspberry Pi zero 2 W. I installed Raspberry Pi OS (Legacy, 64 bit) Lite. Successfully installed numpy-2.0.0 tflite-runtime-2.13.0.

If the issue is Numpy, do I need to down grade to 1.19.5 or so? I noticed you mentioned Numpy<2....

numpy<2 means the version needs to be less than/older than 2, so 2.0.0 won't work.
Also, you won't get good experience under bullseye (tflite-runtime 2.13 is prone to crashing, there is a reason the project was installing the nightly), bookworm is recommended. If you are using the respeaker hat, a branch with some additional changes to workaround a driver installation issue is needed, see #170 (comment)

@owingst
Copy link

owingst commented Jun 23, 2024

I wasn't aware that Bookworm was supported on raspberry pi Zero 2 W. I will give it a shot. Thanks!

@qJake
Copy link

qJake commented Jun 23, 2024

Hi.

I managed to get it to start

Fix is here : DeepLabCut/DeepLabCut#2624 (comment)

I ran this command .venv/bin/pip3 install "numpy<2"


● wyoming-openwakeword.service - Wyoming openWakeWord
     Loaded: loaded (/etc/systemd/system/wyoming-openwakeword.service; disabled; vendor preset: enabled)
     Active: active (running) since Thu 2024-06-20 22:45:12 UTC; 2s ago
   Main PID: 2318 (python3)
      Tasks: 7 (limit: 191)
        CPU: 2.059s
     CGroup: /system.slice/wyoming-openwakeword.service
             ├─2318 python3 /home/pi/wyoming-openwakeword/script/run --uri tcp://127.0.0.1:10400
             └─2321 /home/p4ult/wyoming-openwakeword/.venv/bin/python3 -m wyoming_openwakeword --uri tcp://127.0.0.1:10400

Jun 20 22:45:12 jarvis systemd[1]: Started Wyoming openWakeWord.
Jun 20 22:45:14 jarvis run[2321]: INFO:root:Ready

This worked for me, running on an RPi 4 with:

Linux hostname 6.6.20+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07) aarch64 GNU/Linux

Thanks!

@synesthesiam
Copy link
Contributor

The wyoming-openwakeword repo has been updated to fix some dependency issues for now. Ultimately, I would like to switch to using the main openWakeWord project directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests