TensorFlowASR icon indicating copy to clipboard operation
TensorFlowASR copied to clipboard

How to Create a SavedModel with the Conformer Model

Open hyunwin opened this issue 3 years ago • 6 comments

Hello!

I am pretty new to TensorFlow and have been tasked to deploy TensorFlowASR using Docker. In order to do that, I need the .pb file from the pretrained Conformer Model but don't know exactly how to obtain that. I have tried numerous excerpts of Python code that saves Keras models and creates a .pb file but none were successful. Please help me out!

hyunwin avatar Jul 04 '22 02:07 hyunwin

@hyunwin Have you tried this code: gen_saved_model.py?

nglehuy avatar Jul 12 '22 04:07 nglehuy

Hello,

Yes I have. I was able to get a .pb file but I don't know if the model is pretrained or not from the gen_saved_model.py

hyunwin avatar Jul 12 '22 06:07 hyunwin

@hyunwin The script loads the trained weight here 😄

nglehuy avatar Jul 12 '22 07:07 nglehuy

Oh I see, so if I get the latest.h5 file from the pretrained-subword-conformer.zip, would that output the pretrained .pb file?

hyunwin avatar Jul 12 '22 22:07 hyunwin

Oh I see, so if I get the latest.h5 file from the pretrained-subword-conformer.zip, would that output the pretrained .pb file?

Yeah basically like that. But I'm working on exporting pb for only the model.

nglehuy avatar Jul 16 '22 02:07 nglehuy

Hi again, I was trying to serve the saved_model.pb file that I got from the Conformer model using this tutorial: https://www.tensorflow.org/tfx/serving/docker

I haven't gotten any luck as I think I need the variables and assets folder as well in order to serve it.

hyunwin avatar Jul 18 '22 04:07 hyunwin