[Training] [C# API] TrainingSession EvalStep() doesn't work #18816
Labels
api:CSharp
issues related to the C# API
documentation
improvements or additions to documentation; typically submitted using template
training
issues related to ONNX Runtime training; typically submitted using template
Describe the issue
I am trying to figure out how to use the TrainingSession.EvalStep() function and it seems impossible. It accepts list of input values and list of output values, instead of just returning output values like the C++ function does. So in order to call it, you have to allocate yourself the list of output values, but there is zero documentation around about how to create it, with what dimensions and what are the expected output values.
I have tried this:
and I am getting this error, no matter what dimensions I use to create the output tensor with:
Notice the "Current shape:{1} Requested shape:{}" part in the error message. I have tried all kind of shapes for the output tensor, 0, 1, (1,1), nothing works because it somehow expects the empty shape but I don't know how to create such a tensor.
Side note, you guys should really document this API better, there is zero clues about what should EvalStep return. Should it return tensor of one value, the accuracy, should it return accuracy and probabilities for each output class, what should it return? These kind of things are very important for the users, and your documentation is so generic and bland, it just says:
Not to mention the C# API docs webpage, it's just a skeleton with zero info.
Sorry for the rant but it's kinda deserved :) I am wasting so much time just trying to figure out how to setup parameters in this API.
To reproduce
I am attaching the simple MNIST model converted from PyTorch into ONNX that I am using for testing of training on device: training_artifacts.zip
I am using this code to run EvalStep:
Urgency
No response
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
The text was updated successfully, but these errors were encountered: