Error loading Pretrained model


(Chris Swan) #1

Hi,

I’m trying to use run the pretrained model in linux (via WML ubuntu).
I keep running into the same error message, despite several alternations:

root@SBLaptop:~/DeepSpeech/DeepSpeech# deepspeech --model models/output_graph.pbmm --alphabet models/alphabet.txt --lm models/lm.binary --trie models/trie --audio audio/2830-3980-0043.wav

Loading model from file models/output_graph.pbmm

TensorFlow: v1.11.0-9-g97d851f

DeepSpeech: v0.3.0-0-gef6b5bd

Not found: Op type not registered ‘Assert’ in binary running on SBLaptop. Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (e.g.) tf.contrib.resampler should be done before importing the graph, as contrib ops are lazily registered when the module is first accessed.

Traceback (most recent call last):
File “/usr/local/bin/deepspeech”, line 11, in
sys.exit(main())
File “/usr/local/lib/python3.6/dist-packages/deepspeech/client.py”, line 81, in main
ds = Model(args.model, N_FEATURES, N_CONTEXT, args.alphabet, BEAM_WIDTH)
File “/usr/local/lib/python3.6/dist-packages/deepspeech/init.py”, line 14, in init
raise RuntimeError(“CreateModel failed with error code {}”.format(status))
RuntimeError: CreateModel failed with error code 5

Below is my shell script:

#!/bin/bash

sudo apt-get -y update

curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh

sudo apt-get -y install git-lfs

sudo apt-get -y install python3.6

sudo apt-get -y install python3-pip

git clone https://github.com/mozilla/DeepSpeech

cd DeepSpeech

python3 util/taskcluster.py --target

wget https://github.com/mozilla/DeepSpeech/releases/download/v0.1.0/audio-0.1.0.tar.gz

tar -xvzf audio-0.1.0.tar.gz

wget https://github.com/mozilla/DeepSpeech/releases/download/v0.1.0/deepspeech-0.1.0-models.tar.gz

tar -xvzf deepspeech-0.1.0-models.tar.gz

pip3 install deepspeech

pip3 install -r requirements.txt

chmod u+x util/taskcluster.py

util/taskcluster.py --target models/ --artifact convert_graphdef_memmapped_format --source tensorflow

chmod u+x models/convert_graphdef_memmapped_format

models/convert_graphdef_memmapped_format --in_graph=models/output_graph.pb --out_graph=models/output_graph.pbmm

deepspeech --model models/output_graph.pbmm --alphabet models/alphabet.txt --lm models/lm.binary --trie models/trie --audio audio/2830-3980-0043.wav

I’m virtually a complete beginner with linux so any help or advice is much appreciated!


(Murugan R) #2

@Swan i think you need to create different virtual environments for training and running inference.

you will create new virtual environment then install deepspeech . like this

virtualenv -p python3.6 ~/tmp/ds-test/

source ~/tmp/ds-test/bin/activate

pip3 install deepspeech=0.1.1

and run.:slightly_smiling_face:


(Lissyx) #3

You are using a model that does not match the binaries. Likely a model 0.1.1 with binaries 0.3.0 ?


(Chris Swan) #4

I think that’s exactly right! Thanks for the fast response!


(Chris Swan) #5

I can just note how awesome it is having access to devlopers like yourself! It really makes for a positive learning experience, and promotes the kind of collaboration that moves the world in a positive direction.

Thanks for being amazing!


(Lissyx) #6

Any PR to improve the doc is welcome