5
$\begingroup$

I've re-trained a model (following this tutorial) from the google's object detection zoo (ssd_inception_v2_coco) on a WIDER Faces Dataset and it seems to work if I use frozen_inference_graph.pb from python, but if i take saved_model.pb and put it to tensorflow serving, it predicts a lot of detections all with confidence less than 0.10.

Another thing that I do not understand is that both files are 52Mb however the original files downloaded from the object detection zoo take 98Mb each.

Here's an example of predictions made with the saved_model and tensorflow serving:

Predictions by TensorFlow Serving

And here's example of predictions by the same model, but using frozen_inference_graph.pb:

Predictions by python code and frozen_inference_graph.pb

  1. So what is the actual difference between the saved_model.pb and the frozen_inference_graph.pb?
  2. Are there any ways to inspect what's wrong with the saved_model.pb i use?
  3. How the much smaller size of the re-trained model vs the original could be explained?
$\endgroup$
4
$\begingroup$

saved_model.pb may represent multiple graph definitions as MetaGraphDef protocol buffers. Weights and other variables usually aren't stored inside the file during training. Instead, they're held in separate checkpoint files


Tensorflow Saved Model.


frozen_inference_graph.pb has its variables converted into inline constants so everything’s in one file and ready for serving on any platform including mobile. Freezing process includes loading the GraphDef, pull in the values for all the variables from the latest checkpoint file, and then replace each Variable op with a Const that has the numerical data for the weights stored in its attributes It then strips away all the extraneous nodes that aren't used for forward inference. Reference: Tensorflow Model Files

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.