0

How do I convert a Net to VINO when both .pb and pbtxt format are used to read the net - which of the two best serves ?

frozen_graph = str("detection/240x180_depth0.75_ssd_mobilenetv1/frozen_inference_graph.pb")

text_graph = str("detection/240x180_depth0.75_ssd_mobilenetv1/graph.pbtxt")

cvNet = cv2.dnn.readNetFromTensorflow(frozen_graph, text_graph)

Which of the .pb and pbtxt do I use above? i.e. How does one support the other?

Mrinmay
  • 1
  • 5

2 Answers2

0

The link https://medium.com/@prasadpal107/saving-freezing-optimizing-for-inference-restoring-of-tensorflow-models-b4146deb21b5 will give you an understanding of the different files associated with model. In short, .pbtxt files are human readable which holds only the structure of graph. It helps to check if some nodes are missing for debugging purpose.

.pb files holds much more details and in most cases, it holds the weights and biases on different layers. Hence you need to use .pb file. The link http://answers.opencv.org/question/187904/readnetfromtensorflow-when-loading-customized-model/ will give you some additional details.

0

Only frozen_inference_graph.pb is needed in your case to convert topology to Vino model. As well you would need pipeline.json for model

Go to Model Optimizer folder

python mo_tf.py \
    --input_model <PATH_TO_MODEL>/frozen_inference_graph.pb \
    --tensorflow_use_custom_operations_config extensions/front/tf/ssd_v2_support.json \
    --tensorflow_object_detection_api_pipeline_config <PATH_TO_MODEL>/pipeline.json \
    --input_shape [1,180,240,3]
Dmitry
  • 46
  • 4