NVIDIA-AI-IOT/tf_to_trt_image_classification

how about the score

307509256 opened this issue · 2 comments

I print the output of top 5, the score is such as:-0.18758957, 0.67330343, 2.45672223 .........
but I want to get the score such as: dog : 0.91 cat : 0.23

otherwise, i want to use the model of faster_rcnn_inception_resnet_v2_atrous_coco_11_06_2017.tar

for example:
https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md

how to get the score api by cpp?

Hi @307509256 .

In this project we don't include the softmax post-processing step which gives outputs in the format you mention. It is possible that you could edit scripts/models_to_frozen_graphs.py and apply the tf.nn.softmax operation to the current output node that we have listed.

tf_output = tf.nn.softmax(tf_net, name='scores')

Be sure to replace any output name reference with 'scores'. For example, you will need to update the output_names entry for each model in the NETS dictionary in scripts/model_meta.py to be ['scores'] to use the batch conversion scripts.

Hope to hear if this works for you.