Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6462 Discussions

compile tensorflow inception v3 retrain graph

idata
Employee
1,127 Views

Hi,

 

I have trained a tensorflow inception v3 model following the below steps, can anyone suggest how to convert it to a graph for ncsdk?

 

1.

 

retrain the inception model.

 

ref: https://github.com/googlecodelabs/tensorflow-for-poets-2

 

python scripts/retrain.py --output_graph=tf_files/retrained_graph.pb --output_labels=tf_files/retrained_labels.txt --image_dir=tf_files/images/

 

2.

 

remove nodes so it can be loaded with cv2.dnn.readNetFromTensorflow

 

ref: http://answers.opencv.org/question/175699/readnetfromtensorflow-fails-on-retrained-nn/

 

python ~/tensorflow/tensorflow/python/tools/optimize_for_inference.py \ --input graph.pb \ --output opt_graph.pb \ --frozen_graph True \ --input_names DecodeJpeg/contents \ --output_names final_result ~/tensorflow/bazel-bin/tensorflow/tools/graph_transforms/transform_graph \ --in_graph=opt_graph.pb \ --out_graph=final_graph.pb \ --inputs=Mul \ --outputs=final_result \ --transforms="remove_nodes(op=PlaceholderWithDefault) strip_unused_nodes(type=float, shape=\"1,299,299,3\") sort_by_execution_order"
0 Kudos
0 Replies
Reply