Unable to run deepspeech

I installed all the needed software on my Ubuntu 16.04 including latest Tensorflow, Python etc which all work fine.
I followed all your procedure in creating the virtual env, copied the pre-trained model, audio files etc and run deepspeech but it gives following error.
Appreciate advise what’s gone wrong. Thanks.

deepspeech models/output_graph.pbmm models/alphabet.txt models/lm.binary models/trie 4507-16021-0012.wav
Traceback (most recent call last):
File “/home/anbu/deepspeech-venv/lib/python3.6/site-packages/deepspeech/model.py”, line 18, in swig_import_helper
return importlib.import_module(mname)
File “/home/anbu/deepspeech-venv/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/anbu/deepspeech-venv/bin/deepspeech”, line 7, in
from deepspeech.client import main
File “/home/anbu/deepspeech-venv/lib/python3.6/site-packages/deepspeech/client.py”, line 10, in
from deepspeech.model import Model
File “/home/anbu/deepspeech-venv/lib/python3.6/site-packages/deepspeech/model.py”, line 21, in
_model = swig_import_helper()
File “/home/anbu/deepspeech-venv/lib/python3.6/site-packages/deepspeech/model.py”, line 20, in swig_import_helper
return importlib.import_module(’_model’)
File “/home/anbu/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’

I notice that libcublas.so.8.0 shared lib could n’t be loaded. Cuda 8.0 libs are the older versions. I infact installed later 9.0 version as Tensorflow depends on this. Could it be due to this? It should n’t logically but we never know.

The v0.1.1 is using TensorFlow r1.4, and it depends on CUDA 8.0

ok, thanks. Looks like I 've to get these exact versions installed.

Well it’s unable to find libcublas.so.8 so something is wrong on your setup :slight_smile:

since no cuda 8.0 libs were installed there’s no libcublas.so.8 so in system
(eventhough I have libcublas.so.9 so but of no use since as you said deepspeech uses cuda 8.0)

regarding Tensorflow r1.4 (from tensorflow.org) is this proven to work with deepspeech or there’s any modified/bug fixed one which I could install?

You don’t have to install TensorFlow if you’re just running inference.

It’s been hell to get this basic setup working (that too just inference alone).
Since deepspeech 0.1.1 uses two year old Cuda8.0 tools, it’s a severe limitation to go back to an older version of Cuda from your recent 9.0 version as uninstalling it breaks the packages and we can not use the system for any other development.

So, only way is to fresly install a new linux image (yet another time) and avoid all GPU & Cuda stuff and install the basic CPU only deepspeech environment, which is what I now have. Also installed git lfs as required by deepspeech.

When I run in this mode, this is the error I get (despite activating git lfs) ;
what’s had gone wrong this time (cpu only mode) I 've no idea…I read that this type of error is associated with git lfs(?)…but I thought that has been taken careof…or not?..any pointers?

deepspeech models/output_graph.pb models/alphabet.txt models/lm.binary models/trie 4507-16021-0012.wav

Loading model from file models/output_graph.pb
2018-04-29 14:48:00.018862: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: FMA
Error: Alphabet size does not match loaded model: alphabet has size 3349619, but model has 28 classes in its output. Make sure you’re passing an alphabet file with the same size as the one used for training.
Loaded model in 7.262s.
Loading language model from files models/trie 4507-16021-0012.wav
Loading the LM will be faster if you build a binary file.
Reading models/trie
----5—10—15—20—25—30—35—40—45—50—55—60—65—70—75—80—85—90—95–100
terminate called after throwing an instance of ‘lm::FormatLoadException’
what(): native_client/kenlm/lm/read_arpa.cc:65 in void lm::ReadARPACounts(util::FilePiece&, std::vector&) threw FormatLoadException.
first non-empty line was “1414678853” not \data. Byte: 11
Aborted (core dumped)

Two things:

  1. you can always have a local install of CUDA 8.0 not clashing with your system, and use LD_LIBRARY_PATH (I do that to switch between multiple versions), the CUDA 8.0 requirement is a side-effect from relying on TensorFlow v1.4 ;
  2. You are passing the arguments in the wrong order: check --help, you are passing arguments as documented in master branch while using v0.1.1 binaries, you should have the WAV as the second argument.

Yep…correcting the audio file parameter passing order got it to work…(this order was never mentioned in the documentation I guess). Anyway thanks for pointing it out…

I have to figure out sometime later the best way to have multiple Cuda toolkits installed…

Next, I will try to build deepspeech from sources…

Thanks!