How to transform tensorflow checkpoint model(.meta .index .data) to frozen model (.pb)

Hey guys:

I want to transform this network, https://github.com/jiangsutx/SRN-Deblur, from tensorflow to nvidia tensorRT. It need a ‘.pb’ model file, but the project only giving three model files as follow:

  • deblur.model-52300.data-00000-of-00001
  • deblur.model-52300.index
  • deblur.model-52300.meta

So I want to transform these files to a ‘.pb’ file.

I have tested the ideas given by:

The problem is that both gave ideas are failed because of the get_checkpoint_state() and latest_checkpoint() giving None value.

Is this caused by the missing of checkpoint file?

Are there other ways to implement this?

Any idea is appreciated.

Thanks.

Hello,

this is not TensorRT related.

You can check the scripts provided by Google

have a look at this file freeze_graph.py, you can generate .pb file directly from a checkpoint file and a meta graph.
While executing freeze_graph.py, you can specify the input arguments like this:

--input_meta_graph=/path/to/your/meta/graph/model-1.meta  
 --input_checkpoint=/path/to/your/checkpoint/file/model-1  
 --output_graph=/tmp/frozen_graph.pb  
 --output_node_names="Openpose/concat_stage7"  
 --input_binary=True

Thanks for your help.

hi, in my case I don’t have the .meta file. How can I generate the frozen model ?
output directory of the training looks like this-
training-
-train
-events.out.tfevents.1630519964.DESKTOP-M8813GH.8388.1503.v2
-checkpoint
-ckpt-20.data-00000-of-00001
-ckpt-20.index

Hi,
We recommend you to check the below samples links in case of tf-trt integration issues.

If issue persist, We recommend you to reach out to Tensorflow forum.
Thanks!