TensorSpeech / TensorFlowTTS

:stuck_out_tongue_closed_eyes: TensorFlowTTS: Real-Time State-of-the-art Speech Synthesis for Tensorflow 2 (supported including English, French, Korean, Chinese, German and Easy to adapt for other languages)
https://tensorspeech.github.io/TensorFlowTTS/
Apache License 2.0
3.83k stars 813 forks source link

TensorFlow Lite in C++ doesn't support the TensorFlow operation of Dropout #703

Closed twister11211 closed 2 years ago

twister11211 commented 2 years ago

In the CPP tflite example it says the inference function need delete Dropout before converting tflite model. I have opened the colab after cloning the repository in tensorflow_tts/models/fastspeech2.py I changed training to false on both lines but the runtime crashes, I have also tried deleting the dropout from here like the example describes but it still needs tf.lite.OpsSet.SELECT_TF_OPS

f0_embedding = self.f0_dropout( self.f0_embeddings(tf.expand_dims(f0_outputs, 2)), training=False ) energy_embedding = self.energy_dropout( self.energy_embeddings(tf.expand_dims(energy_outputs, 2)), training=False )

f0_embedding = self.f0_embeddings(tf.expand_dims(f0_outputs, 2)) energy_embedding = self.energy_embeddings(tf.expand_dims(energy_outputs, 2))

Is this the correct way to do this or do I have it wrong

dathudeptrai commented 2 years ago

@twister11211 the last time i tried this model on tensorflow lite was successfully (just need to remove dropout layer). Maybe there is a bug come from tflite itself rather than the code from this repo.