FengYen-Chang / DeepSpeech.OpenVINO

This is the demo application for Deep Speech algorithm, which make speech to text that are being performed on input speech audio.
Mozilla Public License 2.0
5 stars 1 forks source link

Unable to convert deepspeech-0.6.1 model #1

Closed smitesh-sutaria closed 3 years ago

smitesh-sutaria commented 4 years ago

Using https://github.com/FengYen-Chang/open_model_zoo/tree/master/demos/python_demos/deep_speech_demo able to convert deepspeech-0.5.1 model.

But when attempt it on 0.6.1 version, get the below error :


python3 ./mo_tf.py --input_model /root/deepspeech-0.6.0-models/output_graph.pb --freeze_placeholder_with_value "input_lengths->[16]" --input input_node,previous_state_h/read,previous_state_c/read --input_shape [1,16,19,26],[1,2048],[1,2048] --output Softmax,lstm_fused_cell/GatherNd,lstm_fused_cell/GatherNd_1 --disable_nhwc_to_nchw
Model Optimizer arguments:
Common parameters:
        - Path to the Input Model:      /root/deepspeech-0.6.0-models/output_graph.pb
        - Path for generated IR:        /opt/intel/openvino_2020.3.194/deployment_tools/model_optimizer/.
        - IR output name:       output_graph
        - Log level:    ERROR
        - Batch:        Not specified, inherited from the model
        - Input layers:         input_node,previous_state_h/read,previous_state_c/read
        - Output layers:        Softmax,lstm_fused_cell/GatherNd,lstm_fused_cell/GatherNd_1
        - Input shapes:         [1,16,19,26],[1,2048],[1,2048]
        - Mean values:  Not specified
        - Scale values:         Not specified
        - Scale factor:         Not specified
        - Precision of IR:      FP32
        - Enable fusing:        True
        - Enable grouped convolutions fusing:   True
        - Move mean values to preprocess section:       False
        - Reverse input channels:       False
TensorFlow specific parameters:
        - Input model in text protobuf format:  False
        - Path to model dump for TensorBoard:   None
        - List of shared libraries with TensorFlow custom layers implementation:        None
        - Update the configuration file with input/output node names:   None
        - Use configuration file used to generate the model with Object Detection API:  None
        - Use the config file:  None
Model Optimizer version:
[ ERROR ]  Exception occurred during running replacer "REPLACEMENT_ID" (<class 'extensions.front.user_data_repack.UserDataRepack'>): No node with name previous_state_h/read.
 For more information please refer to Model Optimizer FAQ (https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_Model_Optimizer_FAQ.html), question #51.
smitesh-sutaria commented 4 years ago

@FengYen-Chang : Any suggestions ?

FengYen-Chang commented 4 years ago

Hi @smitesh-sutaria ,

Sorry for the late reply. As this demo is only for 0.5.0 version, the deep speech model might have some difference between 0.5.1 and 0.6.0. Therefore, the command for model optimizer and the script for demo might not suitable for the 0.6.0 release. To acquire the correct command for MO, I recommend to use Netron to check the graph, and then acquire the correct node for release 0.6.0.

Such as the following figure, you could see input nodes when you select the node input_node. image

And you also can use Netron to acquire the correct nodes for output, such as below is the output node of the hidden state c. image

Really sorry for the late reply.

FengYen-Chang commented 4 years ago

Hi @smitesh-sutaria , I have update the demo code to version, 0.6.1. Thanks.

smitesh-sutaria commented 4 years ago

Hi @FengYen-Chang , Thank you so much.

How about the latest version 0.7.4 ? https://github.com/mozilla/DeepSpeech/releases/tag/v0.7.4 The 0.7.4 does not have .pb model but only the .pbmm.

We were actually interested in using the latest version 0.7.4.

FengYen-Chang commented 4 years ago

Hi @smitesh-sutaria ,

Actually, I have not tried the version 0.7.4 yet. But you can download the .pb file from here and have a try.

Thanks, John

FengYen-Chang commented 4 years ago

Hi @smitesh-sutaria ,

I have tried the the .pb file of 0.7.4 version, the MO command is same, you just need to change the file name of .pb model. For demo, it only need to patch the parameter upper_frequency_limit from 4000 to 8000 is this 0.7.4 version, and this patch is commited.

Thanks, John