microsoft / microsoft/onnxruntime

C# Load input node names by index

Open
#8,699 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api feature request
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 8h
Merged PRs (30d)
179

Description

Is your feature request related to a problem? Please describe.
We have an application that uses .ONNX model files provided by clients to perform prediction. Dimensions of each input is defined but names of each input could be different in each model.
In python we can do something like: input_name = sess.get_inputs()[index].name to get the name of each input by its index, however, in C# InferenceSession.InputMetadata is a dictionary, and GetInputName method is private, I don't have an API to get input name by index.

System information
onnxruntime nuget package 1.7.0

Describe the solution you'd like
Make InferenceSession.GetInputName a public method

Describe alternatives you've considered
Create a property in InferenceSession class that stores all input nodes' meta data in the order of their index. In the meantime, add Name property to NodeMetadata class.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the InferenceSession API and its InputMetadata and GetInputName members, then inspect NodeMetadata as the proposed alternative. The change is complete when C# callers can obtain an input name by index for client-provided ONNX models, with behavior consistent with the existing input metadata ordering.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, python
Domain
api, machine-learning
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.