JackyTung / tensorgraph

The tensorgraph is a example show how to generate, load graph from tensorflow
Other
37 stars 20 forks source link

How to use checkpoint and graph.pb to merge to freeze graph #5

Closed ashokbugude closed 6 years ago

ashokbugude commented 6 years ago

Can I please know how to freeze graph from .pb and .ckpt files in c++

I am able to do training in c++ and generate .ckpt file , I would like to prediction now for which I needed a freeze graph Please help

jennyHsiao commented 6 years ago

@ashokbugude Please use the command as the author provided:

bazel build tensorflow/python/tools:freeze_graph && \
bazel-bin/tensorflow/python/tools/freeze_graph \
--input_graph=graph.pb \
--input_checkpoint=model.ckpt \
--output_graph=/tmp/frozen_graph.pb --output_node_names=softmax

Brief description:

1) build the freeze_graph tool which is included in tensorflow source code. 2) feed in graph(graph.pb) and checkpoint(model.ckpt). And address the output graph path (/tmp/frozen_graph.pb) and remember to give the name of output_node_name(softmax)

ashokbugude commented 6 years ago

I wanted it in c++ instead of python . Anyway Thanks