Using deepspeech model via Azur IOT EDGE


(Jan) #1

Dear everyone,

I am rather new in tensorflow. I need to implement the deepspeech model by itself, so that it is possible to let it run on our company own platform. In the end it should be imported via the Azure IOT service. (We are not planning on commercialize it but only use it as a demo).

Could someone help me to understand some basic concepts.
I saw that I have several files. The models and the tree (trie-file) and the alphabet.

First of all I will have to import the model, via

'def load_pb(path_to_pb):
    with tf.gfile.GFile(path_to_pb, "rb") as f:
        graph_def = tf.GraphDef()
        graph_def.ParseFromString(f.read())
    with tf.Graph().as_default() as graph:
        tf.import_graph_def(graph_def, name='')
        return graph'

Is that correct?

Second, if I have implemented the model I would have to connect the trie to the model? I have no idea how to do that. Could someone give me a hand?

Then I would have to pass the wave files. Would I just import the Wav file and run the model on it? I see that running inference goes something like this:

prediction = persistent_session.run(y, feed_dict={ x: input_array, keep_prob:1.0})

But I don’t see how to do that with a wav file.

Sorry for this uneducated beginner questions. But I am quite stuck here and would appreciate any help.


(Reuben Morais) #2

Easiest way is by using one of our clients: https://github.com/mozilla/DeepSpeech#using-the-model

There’s also some third-party bindings to other languages: https://github.com/mozilla/DeepSpeech#third-party-bindings

If you absolutely must do it directly with TensorFlow from a checkpoint, the source should guide you, here’s an example: https://github.com/mozilla/DeepSpeech/blob/58126a001355c684c8edf2228f3def87020891bb/DeepSpeech.py#L837-L882


(Jan) #3

Dear Reuben,

thank you a lot for your answer. I would rather not have to do it all directly in tensorflow.
Will this client script on its own do the trick (After pip install deepspeech )?

I am just wondering as I will have to search and pass the wave files automatically to your client.

You can see I am quite overwhelmed.
Thanks again


(Reuben Morais) #4

Just read the README link I sent you, it explains step by step how to use the Python package after doing pip install deepspeech.


(Jan) #5

Dear reuben, thanks for your help. I know that it can be annoying when people ask stuff that is in the readme.
Have a nice day,
Jan