Reputation: 37
I wonder how to anticipate the outputs names matching between local OV model and deployed OV model (using OVMS) with a REST API.
When looking at the model loaded locally, I can see each output multiple names
, for example :
<ConstOutput: names[80, 2162] shape[..100] type: f32>,
The list of names may have different length, for example:
<ConstOutput: names[2169, 2165, tensor, 77, 2160, tensor.37] shape[..100,4] type: f32>
Regarding now the deployed model, each output only have one name that is included each time in the lists shown before, for example:
'outputs': [{'name': '2160', 'datatype': 'FP32', 'shape': ['-1', '4']},
{'name': '2162', 'datatype': 'FP32', 'shape': ['-1']}
When looking at the .xml of the model, it seems that the name appearing on the endpoint info is the first one. However, the order between the xml and the print of the local model info is not the same.
As I need a specific post processing to ensure which output I'm currently looking at, I want to know if there are some rules regarding the outputs names.
Upvotes: 0
Views: 202
Reputation: 86
Use the following sample code to obtain outputs with OpenVINO™ Runtime:
from openvino.runtime import Core
ie = Core()
model = ie.read_model("model_name")
# For model that has only one output
output = model.output
# For model that has more than one output
outputs = model.outputs
Upvotes: 0