Skip to content

How can I rename the IR input / output nodes? #19509

Closed Answered by jiwaszki
yujiepan-work asked this question in Q&A
Discussion options

You must be logged in to vote
# assuming that model is read with core.read_model function
  model = core.read_model(model=test_net_xml, weights=test_net_bin)

  model.inputs[0].tensor.set_names({"abc"})  # first method with set_names
  model.inputs[0].tensor.names = {"abc"}  # using property
  model.inputs[0].tensor.add_names({"abc"})  # appending to existing names

  model.outputs[0].tensor.add_names({"my_results"})  # works similar with outputs

  print(model)  # validate with example print, the names are now available

@yujiepan-work let me know if you need anything else!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by yujiepan-work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants