Deepspeech on ubuntu 18.04

Is Deepspeech on 18.04 not compatible or should I make any more dependency changes?

$ pip3 list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
absl-py (0.4.1)
apturl (0.5.2)
asn1crypto (0.24.0)
astor (0.7.1)
bcrypt (3.1.4)
beautifulsoup4 (4.6.3)
bleach (1.5.0)
Brlapi (0.6.6)
bs4 (0.0.1)
certifi (2018.8.24)
cffi (1.11.5)
chardet (3.0.4)
command-not-found (0.3)
cryptography (2.3.1)
cupshelpers (1.0)
cycler (0.10.0)
decorator (4.1.2)
deepspeech-gpu (0.1.1)
defer (1.0.6)
distro-info (0.18)
entrypoints (0.2.3.post1)
ffmpy (0.2.2)
gast (0.2.0)
get (1.0.3)
grpcio (1.14.2)
html5lib (0.9999999)
httplib2 (0.9.2)
idna (2.7)
ipykernel (4.8.2)
ipython (5.5.0)
ipython-genutils (0.2.0)
ipywidgets (6.0.0)
Jinja2 (2.10)
jsonschema (2.6.0)
jupyter-client (5.2.2)
jupyter-core (4.4.0)
keyring (10.6.0)
keyrings.alt (3.0)
kiwisolver (1.0.1)
language-selector (0.1)
launchpadlib (1.10.6)
lazr.restfulclient (0.13.5)
lazr.uri (1.0.3)
louis (3.5.0)
macaroonbakery (1.1.3)
Mako (1.0.7)
Markdown (2.6.11)
MarkupSafe (1.0)
matplotlib (2.2.3)
mistune (0.8.3)
nbconvert (5.3.1)
nbformat (4.4.0)
notebook (5.2.2)
numpy (1.15.1)
oauth (1.0.1)
olefile (0.45.1)
pandas (0.23.4)
pandocfilters (1.4.2)
paramiko (2.4.1)
pexpect (4.2.1)
pickleshare (0.7.4)
Pillow (5.1.0)
pip (9.0.1)
post (1.0.2)
progressbar2 (3.38.0)
prompt-toolkit (1.0.15)
protobuf (3.6.1)
public (1.0.3)
pyasn1 (0.4.4)
pycairo (1.16.2)
pycparser (2.18)
pycrypto (2.6.1)
pycups (1.9.73)
pydub (0.22.1)
Pygments (2.2.0)
pygobject (3.26.1)
pymacaroons (0.13.0)
PyNaCl (1.2.1)
pyparsing (2.2.0)
pyRFC3339 (1.0)
pysftp (0.2.9)
python-apt (1.6.2)
python-dateutil (2.7.3)
python-debian (0.1.32)
python-speech-features (0.6)
python-utils (2.3.0)
pytz (2018.5)
pyxdg (0.26)
PyYAML (3.12)
pyzmq (16.0.2)
query-string (1.0.2)
reportlab (3.4.0)
requests (2.19.1)
requests-unixsocket (0.1.5)
scipy (1.1.0)
screen-resolution-extra (0.0.0)
SecretStorage (2.3.1)
setuptools (40.2.0)
simplegeneric (0.8.1)
simplejson (3.13.2)
six (1.11.0)
sox (1.3.3)
system-service (0.3)
systemd-python (234)
tensorboard (1.6.0)
tensorflow-gpu (1.6.0)
termcolor (1.1.0)
terminado (0.7)
testpath (0.3.1)
tornado (4.5.3)
traitlets (4.3.2)
ubuntu-drivers-common (0.0.0)
ufw (0.35)
unattended-upgrades (0.1)
urllib3 (1.23)
usb-creator (0.3.3)
virtualenv (15.1.0)
wadllib (1.3.2)
wcwidth (0.1.7)
webencodings (0.5)
Werkzeug (0.14.1)
wget (3.2)
wheel (0.31.1)
xkit (0.0.0)
zope.interface (4.3.2)

as in the above block, I have deepspeech-gpu (0.1.1) and tensorflow-gpu (1.6.0). But in one of the discussion topic I saw for deepspeech version of 0.1.1 we need trnsforflow of 1.4 and a CUDA with the version of 8.0 ?

I had CUDA 9.1 and it was creating some problems when I run deepspeech. So I uninstalled that version. Which version should I install now ?

Is the same versions holds for GPU version based deepspeech?

below is the error trace I am getting when I do deepspeech -h

$ deepspeech -h
Traceback (most recent call last):
File “/home/megha/.local/lib/python3.6/site-packages/deepspeech/model.py”, line 18, in swig_import_helper
return importlib.import_module(mname)
File “/usr/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 955, in _find_and_load_unlocked
File “”, line 658, in _load_unlocked
File “”, line 571, in module_from_spec
File “”, line 922, in create_module
File “”, line 219, in _call_with_frames_removed
ImportError: libcublas.so.8.0: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/megha/.local/bin/deepspeech”, line 7, in
from deepspeech.client import main
File “/home/megha/.local/lib/python3.6/site-packages/deepspeech/client.py”, line 10, in
from deepspeech.model import Model
File “/home/megha/.local/lib/python3.6/site-packages/deepspeech/model.py”, line 21, in
_model = swig_import_helper()
File “/home/megha/.local/lib/python3.6/site-packages/deepspeech/model.py”, line 20, in swig_import_helper
return importlib.import_module(’_model’)
File “/usr/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named ‘_model’

for some more information.

(deepspeech-venv) megha@alughadev:~/2_deepspeech_currrent/DeepSpeech$ nvcc --version
bash: /usr/bin/nvcc: No such file or directory

(deepspeech-venv) megha@alughadev:~/2_deepspeech_currrent/DeepSpeech$ echo $PATH
/home/megha/deepspeech/deepspeech-venv/bin:/home/megha/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

You obviously don’t have proper CUDA 8 setup on this system, as suggested by:

 ImportError: libcublas.so.8.0: cannot open shared object file: No such file or directory

@lissyx okay I will get CUDA 8 installed. But just for clarification, can you please mention for deepspeech-gpu (0.1.1) , which version of Tensorflow , CUDA, and cuDNN is needed. Just to make sure I am not misunderstanding any version dependency. I have messed a lot because of version mistake.

Thanks :slight_smile:

If you are using deepspeech-gpu Python wheel or NodeJS package for running inference, there is no need to install TensorFlow. CUDA v6 and CuDNN v7 as much as I remember.

deepspeech-gpu Python wheel

then why is it mentioned in readme file

Recommendations

If you have a capable (Nvidia, at least 8GB of VRAM) GPU, it is highly recommended to install TensorFlow with GPU support. Training will likely be significantly quicker than using the CPU. To enable GPU support, you can do:

pip3 uninstall tensorflow pip3 install ‘tensorflow-gpu==1.6.0’

As you can notice, this is in the Training subsection. We are referring to inference, not training. The Python wheel, the NodeJS package and the C++ tarball all bundles the proper TensorFlow dependencies for running inference (statically linked into libdeepspeech.so for a while now).

@lissyx initially I got

(deepspeech-venv) megha@megha-ERAZER-X4709-D-C519:/media/home/megha/2_deepspeech_currrent$ deepspeech --help
Traceback (most recent call last):
File “/media/home/megha/2_deepspeech_currrent/deepspeech-venv/lib/python3.6/site-packages/deepspeech/model.py”, line 18, in swig_import_helper
return importlib.import_module(mname)
File “/media/home/megha/2_deepspeech_currrent/deepspeech-venv/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “<frozen importlib._bootstrap>”, line 994, in _gcd_import
File “<frozen importlib._bootstrap>”, line 971, in _find_and_load
File “<frozen importlib._bootstrap>”, line 955, in _find_and_load_unlocked
File “<frozen importlib._bootstrap>”, line 658, in _load_unlocked
File “<frozen importlib._bootstrap>”, line 571, in module_from_spec
File “<frozen importlib._bootstrap_external>”, line 922, in create_module
File “<frozen importlib._bootstrap>”, line 219, in _call_with_frames_removed
ImportError: libcublas.so.8.0: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/media/home/megha/2_deepspeech_currrent/deepspeech-venv/bin/deepspeech”, line 7, in <module>
from deepspeech.client import main
File “/media/home/megha/2_deepspeech_currrent/deepspeech-venv/lib/python3.6/site-packages/deepspeech/client.py”, line 10, in <module>
from deepspeech.model import Model
File “/media/home/megha/2_deepspeech_currrent/deepspeech-venv/lib/python3.6/site-packages/deepspeech/model.py”, line 21, in <module>
_model = swig_import_helper()
File “/media/home/megha/2_deepspeech_currrent/deepspeech-venv/lib/python3.6/site-packages/deepspeech/model.py”, line 20, in swig_import_helper
return importlib.import_module(’_model’)
File “/media/home/megha/2_deepspeech_currrent/deepspeech-venv/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named ‘_model’

so I installed CUDA 8.0. output of nvcc -V is below.

(deepspeech-venv) megha@megha-ERAZER-X4709-D-C519:/media/home/megha/2_deepspeech_currrent$ nvcc -V
nvcc: NVIDIA ® Cuda compiler driver
Copyright © 2005-2016 NVIDIA Corporation
Built on Tue_Jan_10_13:22:03_CST_2017
Cuda compilation tools, release 8.0, V8.0.61

after this when I run deepspeech --help I get as below.

(deepspeech-venv) megha@megha-ERAZER-X4709-D-C519:/media/home/megha/2_deepspeech_currrent$ deepspeech --help
Traceback (most recent call last):
File “/media/home/megha/2_deepspeech_currrent/deepspeech-venv/lib/python3.6/site-packages/deepspeech/model.py”, line 18, in swig_import_helper
return importlib.import_module(mname)
File “/media/home/megha/2_deepspeech_currrent/deepspeech-venv/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “<frozen importlib._bootstrap>”, line 994, in _gcd_import
File “<frozen importlib._bootstrap>”, line 971, in _find_and_load
File “<frozen importlib._bootstrap>”, line 955, in _find_and_load_unlocked
File “<frozen importlib._bootstrap>”, line 658, in _load_unlocked
File “<frozen importlib._bootstrap>”, line 571, in module_from_spec
File “<frozen importlib._bootstrap_external>”, line 922, in create_module
File “<frozen importlib._bootstrap>”, line 219, in _call_with_frames_removed
ImportError: libcudnn.so.6: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/media/home/megha/2_deepspeech_currrent/deepspeech-venv/bin/deepspeech”, line 7, in <module>
from deepspeech.client import main
File “/media/home/megha/2_deepspeech_currrent/deepspeech-venv/lib/python3.6/site-packages/deepspeech/client.py”, line 10, in <module>
from deepspeech.model import Model
File “/media/home/megha/2_deepspeech_currrent/deepspeech-venv/lib/python3.6/site-packages/deepspeech/model.py”, line 21, in <module>
_model = swig_import_helper()
File “/media/home/megha/2_deepspeech_currrent/deepspeech-venv/lib/python3.6/site-packages/deepspeech/model.py”, line 20, in swig_import_helper
return importlib.import_module(’_model’)
File “/media/home/megha/2_deepspeech_currrent/deepspeech-venv/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named ‘_model’

Does this mean I need CUDA of version 6 ?

No, you need CuDNN v6

Just to keep a track, I followed this link and It works fine now.

1 Like

Which documents CUDA 8.0 and CuDNN v6, so not surprising it’s working :slight_smile:

yes, but I followed the main documentation for cuda installation and I was lost in between. I think I make mistake in issuing some commands. But this document had everything step by step. :slight_smile: