Convert Multi-band MelGAN pretrained model to TFLite
See original GitHub issueHi,
I’m looking to convert the pretrained universal vocoder for Multi-band MelGAN into a TensorFlow Lite .tflite
file for use on Android.
I’m trying to convert multiband_melgan.v1_24k
(universal vocoder) to be a drop-in replacement for the mbmelgan.tflite
(not a universal vocoder) file in the Android example, found here.
As this is a .h5
file, my understanding is I need to go .h5
-> .pb
-> .tflite
The problem is, once it reaches load_model
, I get the error ValueError: No model found in config file.
Some research says this is because the model was exported with model.save_weights
, this way the architecture information is not saved.
Is there any way I can load the architecture information so I can make this conversion? I believe this model was added by @ZDisket
Issue Analytics
- State:
- Created 3 years ago
- Comments:20 (12 by maintainers)
Hi, apologies, I worked this out on my own.
I needed to use the MultiBangMelGANGeneratorConfig to load the
.yaml
config that comes with the model.My code then becomes:
Then you can load this into
TFLiteConverter.from_saved_model
, runconvert()
and then write this to a .tflite file 😃Nice, glad you got it to work 😃 did you use TF 2.3.1 or TF nightly?