microsoft / microsoft/onnxruntime

Display all input types on type error

Open
#4,429 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

contributions welcome feature request
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 11h
Merged PRs (30d)
184

Description

**Is your feature request related to a problem? Please describe.**
While trying to convert PyTorch model, I was frustrated trying to understand the types of input tensors after the conversion.
ONNX Runtime only shows an error for the specific input without displaying other inputs.

For example, I would get the following output:
```
onnxruntime.capi.onnxruntime_pybind11_state.InvalidGraph: [ONNXRuntimeError] : 10 : INVALID_GRAPH : This is an invalid model. Type Error: Type 'tensor(int32)' of input parameter (3230) of operator (Clip) in node () is invalid.
```
And from it, I couldn't understand which type is expected and why.

**System information**
- ONNX Runtime version (you are using): 1.3.0

**Describe the solution you'd like**
A clear indication of the expected type and explanation would be great.

**Describe alternatives you've considered**
It will help even if the error shows only types for every input node.

**Additional context**
For now, the only workaround I found is to split the graph and run every part separately. It is time consumable and error-prone method from my perspective.

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

The issue does not identify files, tests, or an entry point. Start by locating ONNX Runtime's invalid-graph type-error reporting and reproduce the PyTorch conversion example; done means the error identifies the expected type and provides the relevant input types clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, pytorch
Domain
machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.