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

add support for model outputs without names #2850

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

dtrawins
Copy link
Collaborator

@dtrawins dtrawins commented Nov 18, 2024

🛠 Summary

CVS-159002
When models have outputs without assigned names, add the name in the model initialization. The following format will be applied OUT_

🧪 Checklist

  • Unit tests added.
  • The documentation updated.
  • Change follows security best practices.
    ``

@dtrawins dtrawins requested a review from mzegla December 18, 2024 09:15
try {
OV_LOGGER("ov::Output<ov::Node> output: {}, output.get_any_name()", reinterpret_cast<const void*>(&output));
if (output.get_names().size() == 0) {
std::unordered_set<std::string> dummy_name{"OUT_" + std::to_string(outputIndex)};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we use lowercase? Isn't it a standard in input/output naming?

# See the License for the specific language governing permissions and
# limitations under the License.
#

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this script meant to be used only manually by developers?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a reference how the test model got created in case some changes should be applied.


input_data = np.ones((1, 10),dtype=np.int8)*10
results = compiled_model({"INPUT1": input_data, "INPUT2": input_data})

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could have some assertion here instead of prints?
I suppose the goal of this script is to generate a model and check if it's valid. In such case checking if output looks as expected would be good.

try {
OV_LOGGER("ov::Output<ov::Node> output: {}, output.get_any_name()", reinterpret_cast<const void*>(&output));
if (output.get_names().size() == 0) {
std::unordered_set<std::string> dummy_name{"OUT_" + std::to_string(outputIndex)};
output.add_names(dummy_name);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not logic related to "applyLayoutConfiguration". Move those changes outside of this method.

@@ -0,0 +1,55 @@
#
# Copyright (c) 2020 Intel Corporation
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change year

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants