Error installing deepspeech on Raspberry Pi 4

Hi all, I am trying to install DeepSpeech on my Raspberry Pi 4 for use in a personal home assistant app. Following a couple of guides, I ran pip3 install deepspeech to install it. I am running into this issue:

$ pip3 install deepspeech
ERROR: Could not find a version that satisfies the requirement deepspeech (from versions: none)
ERROR: No matching distribution found for deepspeech

Some system information (only relevant parts shown):

$ python3 -V
Python 3.7.3
$ pip3 -V
pip 21.3.1 from /home/pi/.local/lib/python3.7/site-packages/pip (python 3.7)
$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linus 10 (buster)"

This seems like a pretty common issue with certain platforms (e.g., this post), but I checked that the rpi4 is supported, and it should be. Any tips or ideas as to why this isn’t working?

1 Like

Actually I see that it is supported up until Python 3.6 on the sidebar on PyPI. Seems a bit weird that there isn’t a wheel available past Python 3.6, and I certainly have no time to start writing anything.

Has anyone successfully built it from source?

1 Like

If you are on aarch64, it is not supported by pip, you can install https://github.com/mozilla/DeepSpeech/releases/download/v0.9.3/deepspeech-0.9.3-cp37-cp37m-linux_aarch64.whl directly.

Thanks, that is what I had recently run into as well. Following up on that – because I am using a raspberry pi, I know that I should use a tflite version. So I installed the whl you had linked and downloaded deepspeech-0.9.3-models.tflite for the model and deepspeech-0.9.3-models.scorer for the scorer, then the provided audio files.

Running deepspeech, I get an error:

$ deepspeech --model deepspeech-0.9.3-models.tflite --scorer deepspeech-0.9.3-models.scorer --audio audio/2830-3980-0043.wav 
Loading model from file deepspeech-0.9.3-models.tflite
TensorFlow: v2.3.0-6-g23ad988
DeepSpeech: v0.9.3-0-gf2e9c85
ERROR: Model provided has model identifier 'Foun', should be 'TFL3'

Error at reading model file deepspeech-0.9.3-models.tflite
Traceback (most recent call last):
  File "/home/pi/.local/bin/deepspeech", line 8, in <module>
    sys.exit(main())
  File "/home/pi/.local/lib/python3.7/site-packages/deepspeech/client.py", line 119, in main
    ds = Model(args.model)
  File "/home/pi/.local/lib/python3.7/site-packages/deepspeech/__init__.py", line 38, in __init__
    raise RuntimeError("CreateModel failed with '{}' (0x{:X})".format(deepspeech.impl.ErrorCodeToErrorMessage(status),status))
RuntimeError: CreateModel failed with 'Failed to initialize memory mapped model.' (0x3000)

Evidently, I am passing in a tflite model in, which is what it is asking for. So I am not quite sure why this isn’t working. Any thoughts?

this clearly states that you are NOT passing a TFLite model. Please check your file?

2 Likes

So I checked and the file was incorrect – it must not have correctly downloaded. I redownloaded and that works now. Thanks for the help!