ModuleNotFoundError: No module named '_impl'

Every time i try run ./deepspeech --model models/output_graph.pbmm --alphabet models/alphabet.txt --lm models/lm.binary --trie models/trie --audio audio_input.wav

i get the no _impl error. Any ideas?

Edit: Ubuntu 18.04 - ive run through all the instructions here:


Also i cant run ‘./deepspeech’ says file not found, so i just run ‘deepspeech’

What version did you installed ? How ?

What version of what? Followed the instructions in that link to the t. Been so frustrating. Is it a cuda issue? The instructions make it seem like i need a gpu/cuda but from what i’ve been reading may not be the case?

What version of DeepSpeech ? What command exactly did you use ? We can’t help you if you don’t share more details. It might be because you installed the CUDA version and you don’t have CUDA setup, but without more details I can’t help you.

What does pip list | grep deepspeech gives ?

It says :Command ‘pip’ not found, but can be installed with: python-pip
But i don’t understand as have used these without a problem
pip3 install deepspeech
pip3 install -r requirements.txt

Is it a different pip or something?

So you don’t need this and we don’t document this for just running inference.

It looks like you have not setup a virtualenv as we suggest in the documentation.

If you installed deepspeech and not deepspeech-gpu, then your error is weird. But if you have not setup a virtualenv then there may be spurious system conflicts.

@mankaden Please share the full output of:

$ LD_DEBUG=libs python3 -c 'from deepspeech import Model'

i have 100% installed a virtual env, its running right now… I think i installed both deepspeech and deepspeech-gpu… is that wrong? :face_with_hand_over_mouth:

LD_DEBUG=libs python3 -c ‘from deepspeech import Model’
798: find library=libc.so.6 [0]; searching
798: search cache=/etc/ld.so.cache
798: trying file=/lib/x86_64-linux-gnu/libc.so.6
798:
798: find library=libpthread.so.0 [0]; searching
798: search cache=/etc/ld.so.cache
798: trying file=/lib/x86_64-linux-gnu/libpthread.so.0
798:
798: find library=libdl.so.2 [0]; searching
798: search cache=/etc/ld.so.cache
798: trying file=/lib/x86_64-linux-gnu/libdl.so.2
798:
798: find library=libutil.so.1 [0]; searching
798: search cache=/etc/ld.so.cache
798: trying file=/lib/x86_64-linux-gnu/libutil.so.1
798:
798: find library=libexpat.so.1 [0]; searching
798: search cache=/etc/ld.so.cache
798: trying file=/lib/x86_64-linux-gnu/libexpat.so.1
798:
798: find library=libz.so.1 [0]; searching
798: search cache=/etc/ld.so.cache
798: trying file=/lib/x86_64-linux-gnu/libz.so.1
798:
798: find library=libm.so.6 [0]; searching
798: search cache=/etc/ld.so.cache
798: trying file=/lib/x86_64-linux-gnu/libm.so.6
798:
798:
798: calling init: /lib/x86_64-linux-gnu/libpthread.so.0
798:
798:
798: calling init: /lib/x86_64-linux-gnu/libc.so.6
798:
798:
798: calling init: /lib/x86_64-linux-gnu/libm.so.6
798:
798:
798: calling init: /lib/x86_64-linux-gnu/libz.so.1
798:
798:
798: calling init: /lib/x86_64-linux-gnu/libexpat.so.1
798:
798:
798: calling init: /lib/x86_64-linux-gnu/libutil.so.1
798:
798:
798: calling init: /lib/x86_64-linux-gnu/libdl.so.2
798:
798:
798: initialize program: python3
798:
798:
798: transferring control: python3
798:
798: find library=libbz2.so.1.0 [0]; searching
798: search cache=/etc/ld.so.cache
798: trying file=/lib/x86_64-linux-gnu/libbz2.so.1.0
798:
798:
798: calling init: /lib/x86_64-linux-gnu/libbz2.so.1.0
798:
798:
798: calling init: /usr/lib/python3.6/lib-dynload/_bz2.cpython-36m-x86_64-linux-gnu.so
798:
798: find library=liblzma.so.5 [0]; searching
798: search cache=/etc/ld.so.cache
798: trying file=/lib/x86_64-linux-gnu/liblzma.so.5
798:
798:
798: calling init: /lib/x86_64-linux-gnu/liblzma.so.5
798:
798:
798: calling init: /usr/lib/python3.6/lib-dynload/_lzma.cpython-36m-x86_64-linux-gnu.so
798:
798: find library=libcrypto.so.1.1 [0]; searching
798: search cache=/etc/ld.so.cache
798: trying file=/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
798:
798:
798: calling init: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
798:
798:
798: calling init: /usr/lib/python3.6/lib-dynload/_hashlib.cpython-36m-x86_64-linux-gnu.so
798:
798: find library=libssl.so.1.1 [0]; searching
798: search cache=/etc/ld.so.cache
798: trying file=/usr/lib/x86_64-linux-gnu/libssl.so.1.1
798:
798:
798: calling init: /usr/lib/x86_64-linux-gnu/libssl.so.1.1
798:
798:
798: calling init: /usr/lib/python3.6/lib-dynload/_ssl.cpython-36m-x86_64-linux-gnu.so
798:
798:
798: calling init: /usr/lib/python3.6/lib-dynload/_json.cpython-36m-x86_64-linux-gnu.so
798:
798: find library=libapt-pkg.so.5.0 [0]; searching
798: search cache=/etc/ld.so.cache
798: trying file=/usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0
798:
798: find library=libstdc++.so.6 [0]; searching
798: search cache=/etc/ld.so.cache
798: trying file=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
798:
798: find library=libgcc_s.so.1 [0]; searching
798: search cache=/etc/ld.so.cache
798: trying file=/lib/x86_64-linux-gnu/libgcc_s.so.1
798:
798: find library=libresolv.so.2 [0]; searching
798: search cache=/etc/ld.so.cache
798: trying file=/lib/x86_64-linux-gnu/libresolv.so.2
798:
798: find library=liblz4.so.1 [0]; searching
798: search cache=/etc/ld.so.cache
798: trying file=/usr/lib/x86_64-linux-gnu/liblz4.so.1
798:
798: find library=libzstd.so.1 [0]; searching
798: search cache=/etc/ld.so.cache
798: trying file=/usr/lib/x86_64-linux-gnu/libzstd.so.1
798:
798: find library=libudev.so.1 [0]; searching
798: search cache=/etc/ld.so.cache
798: trying file=/lib/x86_64-linux-gnu/libudev.so.1
798:
798: find library=librt.so.1 [0]; searching
798: search cache=/etc/ld.so.cache
798: trying file=/lib/x86_64-linux-gnu/librt.so.1
798:
798:
798: calling init: /lib/x86_64-linux-gnu/librt.so.1
798:
798:
798: calling init: /lib/x86_64-linux-gnu/libudev.so.1
798:
798:
798: calling init: /usr/lib/x86_64-linux-gnu/libzstd.so.1
798:
798:
798: calling init: /usr/lib/x86_64-linux-gnu/liblz4.so.1
798:
798:
798: calling init: /lib/x86_64-linux-gnu/libresolv.so.2
798:
798:
798: calling init: /lib/x86_64-linux-gnu/libgcc_s.so.1
798:
798:
798: calling init: /usr/lib/x86_64-linux-gnu/libstdc++.so.6
798:
798:
798: calling init: /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0
798:
798:
798: calling init: /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so
798:
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘deepspeech’
798:
798: calling fini: python3 [0]
798:
798:
798: calling fini: /lib/x86_64-linux-gnu/libutil.so.1 [0]
798:
798:
798: calling fini: /lib/x86_64-linux-gnu/libexpat.so.1 [0]
798:
798:
798: calling fini: /usr/lib/python3.6/lib-dynload/_bz2.cpython-36m-x86_64-linux-gnu.so [0]
798:
798:
798: calling fini: /usr/lib/python3.6/lib-dynload/_lzma.cpython-36m-x86_64-linux-gnu.so [0]
798:
798:
798: calling fini: /usr/lib/python3.6/lib-dynload/_hashlib.cpython-36m-x86_64-linux-gnu.so [0]
798:
798:
798: calling fini: /usr/lib/python3.6/lib-dynload/_ssl.cpython-36m-x86_64-linux-gnu.so [0]
798:
798:
798: calling fini: /usr/lib/x86_64-linux-gnu/libssl.so.1.1 [0]
798:
798:
798: calling fini: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 [0]
798:
798:
798: calling fini: /usr/lib/python3.6/lib-dynload/_json.cpython-36m-x86_64-linux-gnu.so [0]
798:
798:
798: calling fini: /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so [0]
798:
798:
798: calling fini: /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0 [0]
798:
798:
798: calling fini: /lib/x86_64-linux-gnu/liblzma.so.5 [0]
798:
798:
798: calling fini: /lib/x86_64-linux-gnu/libdl.so.2 [0]
798:
798:
798: calling fini: /lib/x86_64-linux-gnu/libbz2.so.1.0 [0]
798:
798:
798: calling fini: /lib/x86_64-linux-gnu/libz.so.1 [0]
798:
798:
798: calling fini: /usr/lib/x86_64-linux-gnu/libstdc++.so.6 [0]
798:
798:
798: calling fini: /lib/x86_64-linux-gnu/libm.so.6 [0]
798:
798:
798: calling fini: /lib/x86_64-linux-gnu/libgcc_s.so.1 [0]
798:
798:
798: calling fini: /lib/x86_64-linux-gnu/libresolv.so.2 [0]
798:
798:
798: calling fini: /usr/lib/x86_64-linux-gnu/liblz4.so.1 [0]
798:
798:
798: calling fini: /usr/lib/x86_64-linux-gnu/libzstd.so.1 [0]
798:
798:
798: calling fini: /lib/x86_64-linux-gnu/libudev.so.1 [0]
798:
798:
798: calling fini: /lib/x86_64-linux-gnu/librt.so.1 [0]
798:
798:
798: calling fini: /lib/x86_64-linux-gnu/libpthread.so.0 [0]

100% wrong, it’s likely to clash. Please uninstall both and reinstall one or the other. Make sure you have the documented CUDA version available on your system if you stick to deepspeech-gpu.

It looks like you have not ran that under the virtualenv, so it’s not really meaningful.

ok i think im getting confused with the instructions. I am new to linux as well so probably my fault. Could you tell me which parts of the instructions to follow without gpu and with a pre trained model?

I’m really not sure how I can describe it better than the current doc: https://github.com/mozilla/DeepSpeech#installing-deepspeech-python-bindings

Download the pre-trained model, setup virtualenv, install deepspeech, that’s it.

ok let me try again. I know it seems simple to you and maybe more experience people but ive probably done 10 installs now all failing. Let me follow those and ill let you know. Cant post the full response of LD_DEBUG as says not enough characters

Ok so this is what i did (fresh ubuntu install): I cloned deepspeech from github, i wget the pre trained model and extracted it into the DeepSpeech folder. I ran the virtual env, installed deepspeech (not gpu) and then i ran:

deepspeech --model models/output_graph.pbmm --alphabet models/alphabet.txt --lm models/lm.binary --trie models/trie --audio models/five.wav

And got these errors:

Loading model from file models/output_graph.pbmm
TensorFlow: v1.12.0-10-ge232881
DeepSpeech: v0.4.1-0-g0e40db6
2019-03-27 18:02:17.173393: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Loaded model in 0.0156s.
Loading language model from files models/lm.binary models/trie
Loaded language model in 0.227s.
Traceback (most recent call last):
File “/home/ubuntu/tmp/deepspeech-venv/bin/deepspeech”, line 10, in
sys.exit(main())
File “/home/ubuntu/tmp/deepspeech-venv/lib/python3.6/site-packages/deepspeech/client.py”, line 91, in main
fin = wave.open(args.audio, ‘rb’)
File “/usr/lib/python3.6/wave.py”, line 499, in open
return Wave_read(f)
File “/usr/lib/python3.6/wave.py”, line 159, in init
f = builtins.open(f, ‘rb’)
FileNotFoundError: [Errno 2] No such file or directory: ‘models/five.wav’

@lissyx

Wait never mind. I copied it to the folder but its not there for some reason. Let me fix that

You are passing as argument an inexistent file …

venv) sehar@sehar-HP-Z220-CMT-Workstation:~/DeepSpeech$ python speech.py models/output_graph1.pb models/alphabet.txt sent6urd.wav
Traceback (most recent call last):
File “/home/sehar/.local/lib/python3.6/site-packages/deepspeech/impl.py”, line 14, in swig_import_helper
return importlib.import_module(mname)
File “/home/sehar/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.10.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 “speech.py”, line 1, in
from deepspeech.model import Model
File “/home/sehar/.local/lib/python3.6/site-packages/deepspeech/init.py”, line 14, in
from deepspeech.impl import PrintVersions as printVersions
File “/home/sehar/.local/lib/python3.6/site-packages/deepspeech/impl.py”, line 17, in
_impl = swig_import_helper()
File “/home/sehar/.local/lib/python3.6/site-packages/deepspeech/impl.py”, line 16, in swig_import_helper
return importlib.import_module(’_impl’)
File “/home/sehar/venv/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named ‘_impl’
i wanted to check my own train model by giving this command please let me know how to resolve this error

Come on !

Isn’t it explicit enough ? It looks like you installed deepspeech-gpu and you don’t have CUDA 10.0 setup correctly.