Converting SSD to frozen graph in tensorflow. Which output node names must be used?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 18:48:18
Jonathan Huang

We have a special tool to convert to frozen graphs in the Tensorflow Object Detection API --- just run the export_inference_graph.py binary. Directions for using this tool are here.

You can explore graph by self: A Tool Developer's Guide to TensorFlow Model Files and find node names. I can give sample from my model: "prefix/digit1/Softmax:0" (it was "digit1" in my keras model) Also as I remember you should provide list of these names to transform_graph utility ("--output" parameter).

i am using this small python script to localize nodes based on its operations. "PLaceholder" and "Identity" appear to be interesting to find Input and Output Nodes:

import tensorflow as tf

NODE_OPS = ['Placeholder','Identity']
MODEL_FILE = '/path/to/frozen_inference_graph.pb'

gf = tf.GraphDef()
gf.ParseFromString(open(MODEL_FILE,'rb').read())

print([n.name + '=>' +  n.op for n in gf.node if n.op in (NODE_OPS)])
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!