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

C++ wrapper loses error information? #23245

Open
sanderstoks opened this issue Jan 3, 2025 · 1 comment
Open

C++ wrapper loses error information? #23245

sanderstoks opened this issue Jan 3, 2025 · 1 comment
Labels
ep:TensorRT issues related to TensorRT execution provider

Comments

@sanderstoks
Copy link

Describe the issue

When trying to follow a C++ tutorial with a model converted using mmdeploy, loading the model failed with a simple empty error message. When trying to debug this, I downloaded the source code for the onnx runtime, stepped into the OrtApis::CreateSession implementation, and found that the real error was this: "[ptr] = 0x0000021eab0ba910 {category=ONNXRUNTIME (2) code=1 msg="Fatal error: mmdeploy:TRTBatchedNMS(-1) is not a registered function/op" }"

I did see this error when I was trying the Python implementation (which is why I started the C++ version in the first place - to see if the mmdeploy stuff was included by default).

I think that one of the error checking macros (ORT_API_RETURN_IF_ERROR?) is swallowing the real error message. I traced it as far down as

#define ORT_API_STATUS_IMPL(NAME, ...)
Success(return == 0) Check_return Ret_maybenull OrtStatusPtr ORT_API_CALL NAME(VA_ARGS) NO_EXCEPTION

but there I lost track.

To reproduce

The model is too big to upload as an example, but perhaps it will work using any other model that gives the above error message.

Urgency

Not urgent, but may save people time in the future. It's because I saw the mmdeploy issue in the Python implementation that I had a hunch what was going on, but otherwise the symptom is just "the model failed to load."

Platform

Windows

OS Version

11

ONNX Runtime Installation

Built from Source

ONNX Runtime Version or Commit ID

1.20.1

ONNX Runtime API

C++

Architecture

X64

Execution Provider

Default CPU

Execution Provider Library Version

No response

@yuslepukhin yuslepukhin added the ep:TensorRT issues related to TensorRT execution provider label Jan 6, 2025
@yuslepukhin
Copy link
Member

You may want to supply a sample model to make progress on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ep:TensorRT issues related to TensorRT execution provider
Projects
None yet
Development

No branches or pull requests

2 participants