LearnedVector / A-Hackers-AI-Voice-Assistant

A hackers AI voice assistant, built using Python and PyTorch.
https://www.youtube.com/playlist?list=PL5rWfvZIL-NpFXM9nFr15RmEEh4F4ePZW
MIT License
1.02k stars 358 forks source link

Running On Raspberry Pi 4 #103

Open JianHe0628 opened 2 years ago

JianHe0628 commented 2 years ago

Hii, I am really new to the community, and I have hit rock bottom on this

I have been trying for weeks to test the model on the Raspberry Pi 4 but to no avail. From what I understand, I am suppose to run the engine.py file and specify the model file. However, the engine.py requires the torch, torchaudio, and several other packages which are not in the rpi-requirement.txt file.

So I have tried to download the packages with the requirements.txt file, but there are always errors such as (unable to locate version). This also happens when I try it with the rpi-requirements.txt file. I have suspected that it was my OS version, and python issue. But after going through multiple versions and even ubuntu versions, I still cannot get it to work.

I just wanted to ask if there is any specific raspbian OS, python, or pip version that I need? Or maybe am I on the wrong track?

I have finished training the model and optimizing it on my PC, I just cant get it to work on the Raspberry

Edit: I have solved the problem. The engine.py file runs okay if you are using torchaudio 0.7.2 with torch 1.7.1. Or you could use newer torch and torchaudio versions, but you will need to change the code from normalization to normalize. Downloading torchaudio 0.7.2 was done using pip install with reference to the pytorch website.

JianHe0628 commented 2 years ago

[UPDATE] After further testing, it is found that performance may be better with versions of torchaudio 0.5.0 and torch 1.5.0. Additionally, training the Model with a 50/50 split for Wake Word and Non Wake Word class may not yield the best results. From my experience, 10/90 split works better.