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

Viewed 4121

I trained SSD using TensorFlow Object Detection API as described here. It produces a ckpt, meta and index file. In order to run it on my images I tried to check the demo code. It requires that the model be converted to frozen graph. I tried to convert my model to a frozen inference graph as described here. In that program I have to provide output node names. I could not figure out the name of the node in the SSD model which must be used here. Please help. I tried 'num_detections:0', 'detection_boxes:0' etc. Only to get error:

AssertionError: num_detections is not in graph

3 Answers

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)])
Related