coqui-ai / STT

🐸STT - The deep learning toolkit for Speech-to-Text. Training and deploying STT models has never been so easy.
https://coqui.ai
Mozilla Public License 2.0
2.27k stars 275 forks source link

Bug: Unable to install on new raspberry pi 4 #2028

Closed marclundgren closed 2 years ago

marclundgren commented 2 years ago

Describe the bug Unable to install on new raspberry pi 4

To Reproduce Steps to reproduce the behavior:

  1. Follow the official install instructions
  2. run python -m pip install coqui-stt-model-manager. The following error occurs: (full output)
ERROR: Cannot install coqui-stt-model-manager==0.0.10, coqui-stt-model-manager==0.0.11, coqui-stt-model-manager==0.0.12, coqui-stt-model-manager==0.0.14, coqui-stt-model-manager==0.0.15, coqui-stt-model-manager==0.0.16, coqui-stt-model-manager==0.0.17, coqui-stt-model-manager==0.0.18, coqui-stt-model-manager==0.0.8 and coqui-stt-model-manager==0.0.9 because these package versions have conflicting dependencies.

The conflict is caused by:
    coqui-stt-model-manager 0.0.18 depends on stt==1.0.0
    coqui-stt-model-manager 0.0.17 depends on stt==0.10.0a13
    coqui-stt-model-manager 0.0.16 depends on stt==0.10.0a13
    coqui-stt-model-manager 0.0.15 depends on stt==0.10.0a13
    coqui-stt-model-manager 0.0.14 depends on stt==0.10.0a13
    coqui-stt-model-manager 0.0.12 depends on stt==0.10.0a6
    coqui-stt-model-manager 0.0.11 depends on stt==0.10.0a6
    coqui-stt-model-manager 0.0.10 depends on stt==0.10.0a6
    coqui-stt-model-manager 0.0.9 depends on stt==0.10.0a6
    coqui-stt-model-manager 0.0.8 depends on stt==0.10.0a6

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

Expected behavior The installation succeeds

Additional context

python 3.9.2
pip 21.3.1 from /home/pi/$MYPROJECT/venv-stt/lib/python3.9/site-packages/pip (python 3.9)

I ran the same installation instructions on my mac, and it successfully installs

dhkar commented 2 years ago

I have the same issue and i'm waiting for the next update

reuben commented 2 years ago

Can you try installing the stt package manually first, directly from the wheel file? It seems like pip is trying to install stt from PyPI, which is not supported on Raspberry Pi. You can download the wheel file from our release page, eg: https://github.com/coqui-ai/STT/releases/download/v1.0.0/stt-1.0.0-cp37-cp37m-linux_armv7l.whl

dhkar commented 2 years ago

Thanks @reuben! it worked for me after installing wheel manually. A little note that we might find the import error exception from the NumPy after running stt-model-manager. To overcome this, alternatively we can install missing NumPy libraries by:

sudo apt-get install libatlas-base-dev

I was installing this outside virtual environment (not sure if it is right method ?). And after install this missing library, executing stt-model-manager command would redirect us to flask app (which means it was installed successfully in Raspberry Pi 4).

To read more about troubleshoot NumPy importError : https://numpy.org/devdocs/user/troubleshooting-importerror.html

marclundgren commented 2 years ago

Any tips on how to install the wheel manually? I'm trying to find instructions for it somewhere in this repo but coming up empty.

# download
wget https://github.com/coqui-ai/STT/releases/download/v1.0.0/stt-1.0.0-cp37-cp37m-linux_armv7l.whl

## and then how do I install it?
dhkar commented 2 years ago

Make sure the .whl file is in the work directory (in the virtual environment as shown by docs), then you can do this in terminal: pip install <name_of_wheel_file>.whl

After stt package (from previous .whl file) as one of the dependency of coqui-stt-model installed, then install another dependency using command instructed by the docs: python -m pip install coqui-stt-model-manager

Reference : https://stackoverflow.com/questions/27885397/how-do-i-install-a-python-package-with-a-whl-file

marclundgren commented 2 years ago

Thank you @dhkar. I'm still seeing an error related to my device architecture

pip install .whl

$ pip install stt-1.0.0-cp37-cp37m-linux_armv7l.whl 
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
ERROR: stt-1.0.0-cp37-cp37m-linux_armv7l.whl is not a supported wheel on this platform.

Here's my cpuinfo

$ cat /proc/cpuinfo
processor   : 0
model name  : ARMv7 Processor rev 3 (v7l)
BogoMIPS    : 108.00
Features    : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part    : 0xd08
CPU revision    : 3

processor   : 1
model name  : ARMv7 Processor rev 3 (v7l)
BogoMIPS    : 108.00
Features    : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part    : 0xd08
CPU revision    : 3

processor   : 2
model name  : ARMv7 Processor rev 3 (v7l)
BogoMIPS    : 108.00
Features    : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part    : 0xd08
CPU revision    : 3

processor   : 3
model name  : ARMv7 Processor rev 3 (v7l)
BogoMIPS    : 108.00
Features    : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part    : 0xd08
CPU revision    : 3

Hardware    : BCM2711
Revision    : c03111
Serial      : 10000000535f67d9
Model       : Raspberry Pi 4 Model B Rev 1.1
reuben commented 2 years ago

For RPi4 you need the aarch64 wheel. It's also in the release page.

marclundgren commented 2 years ago
pip install stt-1.1.0-cp37-cp37m-linux_aarch64.whl
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
ERROR: stt-1.1.0-cp37-cp37m-linux_aarch64.whl is not a supported wheel on this platform.
marclundgren commented 2 years ago

@reuben can you check to see if i'm doing something wrong? I only see one aarch64 wheel in the releases page

marclundgren commented 2 years ago

Is uboot-raspberrypi a prerequisite? Also, I have the 4GB board.

dhkar commented 2 years ago

How about the version of your python? I'm using Python3.7 and it matches with the wheel with the name consists of tag cp37.

marclundgren commented 2 years ago
python --version
Python 3.9.2
reuben commented 2 years ago

We only support Python 3.7 on Raspberry Pi 3 and 4.

marclundgren commented 2 years ago
$ which python
/home/pi/.pyenv/shims/python

$ python -V
Python 3.7.12

$ pip install stt-1.1.0-cp37-cp37m-linux_aarch64.whl
ERROR: stt-1.1.0-cp37-cp37m-linux_aarch64.whl is not a supported wheel on this platform.
WARNING: You are using pip version 20.1.1; however, version 21.3.1 is available.
You should consider upgrading via the '/home/pi/.pyenv/versions/3.7.12/bin/python3.7 -m pip install --upgrade pip' command.

$ pip -V
pip 20.1.1 from /home/pi/.pyenv/versions/3.7.12/lib/python3.7/site-packages/pip (python 3.7)
marclundgren commented 2 years ago

@reuben is there a patch version of python 3.7 i should target?

marclundgren commented 2 years ago

I ended up choosing the latest vanilla 3.7.12, but it seems like there's plenty more to choose from. Which one is right for this project?

$ pyenv install --list | grep 3.7
  2.3.7
  3.3.7
  3.7.0
  3.7-dev
  3.7.1
  3.7.2
  3.7.3
  3.7.4
  3.7.5
  3.7.6
  3.7.7
  3.7.8
  3.7.9
  3.7.10
  3.7.11
  3.7.12
  miniconda-3.7.0
  miniconda3-3.7.0
  miniconda3-3.7-4.8.2
  miniconda3-3.7-4.8.3
  miniconda3-3.7-4.9.2
  miniconda3-3.7-4.10.3
  pypy3.7-c-jit-latest
  pypy3.7-7.3.2-src
  pypy3.7-7.3.2
  pypy3.7-7.3.3-src
  pypy3.7-7.3.3
  pypy3.7-7.3.4-src
  pypy3.7-7.3.4
  pypy3.7-7.3.5-src
  pypy3.7-7.3.5
  pypy3.7-7.3.6-src
  pypy3.7-7.3.6
  pypy3.7-7.3.7-src
  pypy3.7-7.3.7
  pypy3.8-7.3.7-src
  pypy3.8-7.3.7
  stackless-3.3.7
  stackless-3.7.5
marclundgren commented 2 years ago

update on my end. Once I had python 3.7 installed, i was able to install the arm7 wheel.

pip install stt-1.0.0-cp37-cp37m-linux_armv7l.whl

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Processing ./stt-1.0.0-cp37-cp37m-linux_armv7l.whl
Collecting numpy<=1.19.4,>=1.14.5
  Downloading https://www.piwheels.org/simple/numpy/numpy-1.19.4-cp37-cp37m-linux_armv7l.whl (10.5 MB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 10.5 MB 2.6 MB/s
Installing collected packages: numpy, stt
Successfully installed numpy-1.19.4 stt-1.0.0

Not sure why you thought I needed the aarch64 wheel, but the arm7 package worked for me @reuben

ludwikbukowski commented 1 year ago

Btw guys is it just me or raspberry PI 4B have very poor performance when running those models? I dont mean latencies but general accuracy, it wasnt even close to what I was saying On the other hand, I tested on macbook pro m1 and worked like a charm

HarikalarKutusu commented 1 year ago

If the models (acoustic and language models) are the same, that might mean the problem is because of the microphone on RPi 4 and related audio processing. The mic on an Apple notebook in conjunction with its drivers might have some noise suppression - AFAIK most webcam drivers have such features.

To debug this, I'd attach a quality mic/webcam with good drivers, possibly enabling some noise suppression - if such a thing even exists.

(Disclaimer: I didn't use RPi 4 for inference yet)

ludwikbukowski commented 1 year ago

Dear @HarikalarKutusu Thanks for your response. Indeed I tried the same Raspberry 4B in the house of my girlfriend with different acoustics and closer to the mic and the model worked perfectly well. I will consider re-arranging the mic location in my place to achieve the same results. Thanks again!

97Cweb commented 1 year ago

I am having similar issues. Has STT been updated to a newer version of Python for raspberry Pi. Also, are there instructions to install on Raspberry Pi now?

97Cweb commented 1 year ago

For those looking, I got stt installed with the following on raspberry pi:

wget https://github.com/coqui-ai/STT/releases/download/v1.4.0/stt-1.4.0-cp39-cp39-linux_aarch64.whl pip install stt-1.4.0-cp39-cp39-linux_aarch64.whl