You are right, it should be from deepspeech import Model
.
Now I am getting other error related with model.
I have code:
from deepspeech import Model
import scipy.io.wavfile as wav
import sys
deepspeech = Model('models/output_graph.pb', 26, 9, 'alphabet.txt', 500)
audio_rate, audio_data = wav.read('./my_audio_file.wav')
processed_data = deepspeech.stt(audio_data, audio_rate)
print(processed_data)
And I am getting error:
TensorFlow: v1.11.0-9-g97d851f
DeepSpeech: v0.3.0-0-gef6b5bd
Warning: reading entire model file into memory. Transform model file into an mmapped graph to reduce heap usage.
2018-11-24 23:24:22.992453: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Not found: Op type not registered 'Assert' in binary running on Promotheus. 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 "script2.py", line 6, in <module>
deepspeech = Model('models/output_graph.pb', 26, 9, 'alphabet.txt', 500)
File "/home/ugnelis/anaconda3/envs/deepspeech/lib/python3.6/site-packages/deepspeech/__init__.py", line 14, in __init__
raise RuntimeError("CreateModel failed with error code {}".format(status))
RuntimeError: CreateModel failed with error code 5
Do I use also deprecated method? And maybe there is normal documentation of Mozilla Deepspeech where methods would be described?