Skip to content

How to convert checkpoint file to model .pb file using tf.saved_model.builder.SavedModelBuilder to host on tensorflow serving #897

@gr8Adakron

Description

@gr8Adakron

Basically I have models which are already developed in Mxnet and I want to convert them into tensorflow serving format without performing retraining.

So for performing conversion from Mxnet to Tensorflow I have used this Intermediate layer created by Microsoft Mdnn.

Using this tool/library I was able to convert Mxnet model files to Tensorflow checkpoint format:
mxnet model drectories

These are initial Mxnet model files.
And this is my flow of conversion.

Mxnet_model => IR format => Conversion code => Checkpoint => Tensorflow Model, Serving format

IR = intermediate representation
I have successfully converted till checkpoint files using this instruction Mxnet to IR then IR to Tensorflow checkpoint

This final structure of tensorflow checkpoint file are:
tensorflow checkpoint

The only step remaining is to convert and save these checkpoint files to .pb and variable folder format using this SaveBuilder function
Saving using this function is essentials because its is the only valid format to save the model, inorder to serve the model on tensorflow serving

This is how the final structure of the converted model must look like in order to get served using TF-serving:

save_model_format

This is the accurate structure which TF-serving accept and generate predictions for.

I tried using these scripts freeze_graph.py and incepiton_save_model.py but nothing came out they have some arguments which I don't have files to pass.

Help!!!
Is there a way? I am trying since last 3days but couldn't find anything.
Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions