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

[Training] [C# API] There is no way to get input dimensions from onnx model #18794

Open
peratrepic opened this issue Dec 12, 2023 · 2 comments
Open
Labels
feature request request for unsupported feature or enhancement training issues related to ONNX Runtime training; typically submitted using template

Comments

@peratrepic
Copy link

Describe the issue

InferenceSession class provides an API to get input dimensions:

using (InferenceSession inferenceSession = new InferenceSession(TRAINED_MODEL_PATH))
{
    int[] inputDims = inferenceSession.InputMetadata[inferenceSession.InputNames[0]].Dimensions;
}

TrainingSession class provides no such API, nor have I found any other way to load the model using C# ONNX API and read the input dimensions.

To reproduce

Should be clear from issue description, not really much to reproduce, it's just a missing functionality.

Urgency

We are trying to implement on device training scenario and currently we have to send model input dimensions together with onnx model, which seems redundant because that info is already written inside ONNX model, but ONNX C# SDK has no API to extract that info.

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.16.3

PyTorch Version

2.01

Execution Provider

Default CPU

Execution Provider Library Version

No response

@peratrepic peratrepic added the training issues related to ONNX Runtime training; typically submitted using template label Dec 12, 2023
@baijumeswani baijumeswani added the feature request request for unsupported feature or enhancement label Jan 3, 2024
@baijumeswani
Copy link
Contributor

@peratrepic Thanks for opening this issue. We will evaluate if this is something we can easily add to the training API in C# before the upcoming release.

@GeorgeS2019
Copy link

Add image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request request for unsupported feature or enhancement training issues related to ONNX Runtime training; typically submitted using template
Projects
None yet
Development

No branches or pull requests

3 participants