Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Rename inputs/outputs #24485

Closed
1 task done
pvardanis opened this issue May 13, 2024 · 2 comments · Fixed by #24522
Closed
1 task done

[Feature Request]: Rename inputs/outputs #24485

pvardanis opened this issue May 13, 2024 · 2 comments · Fixed by #24522
Assignees
Labels
category: Python API OpenVINO Python bindings enhancement New feature or request feature New feature request
Milestone

Comments

@pvardanis
Copy link

Request Description

It would be nice we have support for renaming inputs/outputs on the IR graph similarly as ONNX does. Any specific reason why's this not available as of now?

Feature Use Case

No response

Issue submission checklist

  • The feature request or improvement must be related to OpenVINO
@pvardanis pvardanis added enhancement New feature or request feature New feature request labels May 13, 2024
@rkazants
Copy link
Contributor

Hi @pvardanis,

The requested functionality is really questionable. Can you please elaborate your request: what are real use cases, usage frequency? How is it important if user can just manually modify IR by editing .xml file (just replace names attribute for Parameter node)? However, be cautioned that model can be corrupted in case conflicting tensor names after this modification. That is one of the reason to be careful with implementing such functionality.

We always chase alignment with original frameworks: preserving original input/output tensor names, out-of-the-box experience for inference (without any model modification). We take the most important functionality to our API that influence performance, easy transfer from original framework to OpenVINO. In the meantime, we don't overload our API with new methods that are questionable. It must be reasonable and proved.

Best regards,
Roman

@rkazants
Copy link
Contributor

Hi @pvardanis,

Please ignore my previous message. Apologize, I was mistaken about absence of functionality for setting input names.

In C++ ov::Output<ov::Node> representing tensor provides a method set_names() to set a new name: https://github.com/openvinotoolkit/openvino/blob/master/src/core/include/openvino/core/node_output.hpp#L86

Your code will look like as follows:

    std::shared_ptr<ov::Model> ov_model = ...;
    auto some_input = ov_model->input("old_name");
    some_input.set_names({"new_name"});

    // inference code ...

I think you can do the same trick for compiled model ov::CompiledModel.

Unfortunately, we have no such method for Output in Python API. I will ask my colleagues to add it asap.
@mlukasze, please align Python API for Output with C++, now it misses setters like set_names().

Thanks to @ilya-lavrenov for advice and catch-up.

Best regards,
Roman

@rkazants rkazants added the category: Python API OpenVINO Python bindings label May 15, 2024
@rkazants rkazants linked a pull request May 15, 2024 that will close this issue
@ilya-lavrenov ilya-lavrenov added this to the 2024.2 milestone May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Python API OpenVINO Python bindings enhancement New feature or request feature New feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants