I’m trying to use DeepSpeech with the pre-trained model on a Raspberry Pi 3 running Raspbian Stretch. While the Python package works, I cannot get the native client to run. I tried installing the native client using taskcluster.py, as well as directly downloading native_client.rpi3.cpu.linux.tar.xz from the v0.5.0-alpha.0 pre-release section, but in both cases the same error occurs:
$ ./deepspeech --model models/output_graph.pbmm --alphabet models/alphabet.txt --lm models/lm.binary --trie models/trie --audio test.wav
TensorFlow: v1.12.0-10-ge232881
DeepSpeech: v0.5.0-alpha.0-2-g13c9bab
Could not enable CTC decoder with LM.
Is the native client for the Raspberry Pi 3 already expected to work despite being an alpha version?
1 Like
lissyx
((slow to reply) [NOT PROVIDING SUPPORT])
2
@Rakksor Does it works without the language model? FYI with the current language model, on this platform, you will not get decent performances regarding inference time.
lissyx
((slow to reply) [NOT PROVIDING SUPPORT])
3
@Rakksor This error can cover a lot of cases. Are models/lm.binary and models/trie readable ? How much memory (+ swap) do you have ?
Thanks for the fast answer. It does indeed work without the language model.
The model files should all be readable:
$ ls -l models/
total 2517772
-rw-r--r-- 1 pi pi 329 Sep 18 15:10 alphabet.txt
-rw-r--r-- 1 pi pi 1800894585 Sep 18 15:10 lm.binary
-rw-r--r-- 1 pi pi 188909526 Jan 9 14:34 output_graph.pb
-rw-r--r-- 1 pi pi 188910116 Jan 9 14:35 output_graph.pbmm
-rw-r--r-- 1 pi pi 188909526 Jan 9 14:38 output_graph.rounded.pb
-rw-r--r-- 1 pi pi 188910116 Jan 9 14:39 output_graph.rounded.pbmm
-rw-r--r-- 1 pi pi 21627983 Jan 7 10:45 trie
The available memory is 1Gb of RAM and a 100Mb swap file (Raspbian default):
$ free -h
total used free shared buff/cache available
Mem: 927M 32M 248M 6.2M 645M 831M
Swap: 99M 0B 99M
But since the Python client is able to use the same language model files, the problem seems to be specific to the native client:
$ deepspeech --model models/output_graph.pbmm --alphabet models/alphabet.txt --lm models/lm.binary --trie models/trie --audio test.wav
Loading model from file models/output_graph.pbmm
TensorFlow: v1.12.0-10-ge232881
DeepSpeech: v0.4.1-0-g0e40db6
Loaded model in 0.033s.
Loading language model from files models/lm.binary models/trie
Loaded language model in 0.000704s.
Running inference.
this is a tist
Inference took 57.110s for 3.000s audio file.
Then again, I’m not sure the Python client really uses the language model, as inference time is the same as when not specifying it. Also, shouldn’t “tist” be corrected if the language model is used?
lissyx
((slow to reply) [NOT PROVIDING SUPPORT])
5
That’s another question. It’s weird if it does not work with native client but it does with python, it’s mostly the same code, and we have CI coverage of running on those platforms with language model
lissyx
((slow to reply) [NOT PROVIDING SUPPORT])
6
@Rakksor Hm, just checked, we don’t do any error checking on the loading of the language model in Python, so it might explain why you see that difference. I’m not sure, however, why it fails to load the LM. I’ll see if I can find some time to investigate, but honestly RPi3 is not top priority those days.
I was just curious to see how fast it performs on a Raspberry Pi, so the issue is not really urgent. Btw, since you mentioned memory, I tried increasing the size of the swap file to 2Gb, that didn’t help though.