Dear community,
I am trying to integrate a DeepSpeech trained model into a larger network. I have read the paper and the documentation several times, and also several posts here. However, I am still struggling to understand several things.
Apologies if this has been asked before or if what I say does not make sense, as I am still relatively new to this.
What I am trying to do is the following:
- Load pre-trained deepspeech model (deepspeech-0.9.1-models.pbmm)
- Obtain the output of layer_5
- Add a CNN layer
- Train
My main problem is how to load the model as a tensorflow model, so then I can add more layers and train them. I have looked into the client.py as it creates a Model using the python API, but I do not seem to be able to access any layers from the Model (I think I may have been confusing things here). I have also looked into train.py/create_model, but again I am not sure how to use that externally as if I do something like this:
from deepspeech_training.train import create_model
model = create_model(batch_x=input_tensor, batch_size=batch_size, seq_lenght=None, dropout=no_dropout)
I get a RuntimeError(“Global configuration not yet initialized.”).
I have also tried adding:
from deepspeech_training.util.config import Config, initialize_globals
initialize_globals()
But some arguments seem to be missing, and I am obviously doing something wrong…
I also have the checkpoint file, but as far as I understand I still need a model to load the values…
If anyone could give me some indications on how to load this model for the purpose I explained, it would be very appreciated. The documentation shows how to perform transfer-learning but using the command line only, which is not what I need.
Details
Platform OS
- Linux
Python Environment
-
Python 3.7.7
-
Virtual env: Venv / virtualenv