Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.
6058 Discussions

output_blobs of InferRequest in 2022 version

SidneyZ
Beginner
205 Views

I'm using OpenVino 2022.1.

In previous version 2021.4, use 

res = exec_net.requests[cur_request_id].outputs[out_blob] as 

SidneyZ_1-1658488689432.png

but now in 2022.1, I tried to use 

detection_classes = exec_net.requests[cur_request_id].output_blobs['detection_classes']

but got "KeyError: 'detection_classes'" error.

SidneyZ_3-1658488875511.png

 

SidneyZ_2-1658488764755.png

in model.xml, the output lay defined as the followings,

SidneyZ_0-1658488358379.png

<output value="['detection_classes', 'detection_scores', 'detection_boxes', 'num_detections']"/>

 

what's wrong with my code?

can anyone give me some hint?

 

regards

sidney

Labels (1)
0 Kudos
2 Replies
Peh_Intel
Moderator
182 Views

Hi Sidney,


Thanks for reaching out to us.


You’re getting "KeyError: 'detection_classes'" error because there is no such layer name in the XML file.


The output layers defined in the model.xml are from the original model’s output layers, which are ‘detection_classes', 'detection_scores', 'detection_boxes' and 'num_detections. After converting into IR, the converted model only has an array of summary detection information, named as ‘DetectionOutput’ if the model is ssd_mobilenet_v1_coco.


On another hand, you can get the output layer name in XML file with Netron or with coding:

out_blob=next(iter(net.outputs))

print(out_blob)



Regards,

Peh


Peh_Intel
Moderator
168 Views

Hi Sidney,


This thread will no longer be monitored since we have provided a solution. If you need any additional information from Intel, please submit a new question.



Regards,

Peh


Reply