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

Why C++ cannot modify the enable_mem_reuse option in Ort::SessionOptions... #21942

Open
WYX523 opened this issue Aug 31, 2024 · 3 comments
Open
Labels
stale issues that have not been addressed in a while; categorized by a bot

Comments

@WYX523
Copy link

WYX523 commented Aug 31, 2024

Describe the issue

I have trained a model and export to onnx, but I got an error when infer by ort:
Non-zero status code returned while running Expand node. Name:'/GaussianDiffusionModel/Expand' Status Message: /GaussianDiffusionModel/Expand: left operand cannot broadcast on dim 0 LeftShape: {110}, RightShape: {118}

when I unable the enable_mem_reuse option in python, it works, but I cannot find the modification method in cpp, how can I unable this option with c/cpp program and resolve this problem?

To reproduce

inline std::shared_ptr<Ort::SessionOptions> CreateDefaultSessionOptions(size_t numThreads) {
    auto sessionOptionsPtr = std::make_shared<Ort::SessionOptions>();
    sessionOptionsPtr->SetIntraOpNumThreads(numThreads);
    sessionOptionsPtr->SetInterOpNumThreads(numThreads);
    sessionOptionsPtr->SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_DISABLE_ALL);
    return sessionOptionsPtr;
}

Urgency

No response

Platform

Linux

OS Version

CentOS

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.18.1

ONNX Runtime API

C++

Architecture

X86

Execution Provider

Default CPU, CUDA

Execution Provider Library Version

CUDA 11.8

@WYX523
Copy link
Author

WYX523 commented Sep 2, 2024

And I'm so doubtful that the option is opened in python but not in c++...

@pranavsharma
Copy link
Contributor

Not sure what you mean by "unable". Here are the C++ equivalents: EnableCpuMemArena() and DisableCpuMemArena().

Copy link
Contributor

github-actions bot commented Oct 4, 2024

This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.

@github-actions github-actions bot added the stale issues that have not been addressed in a while; categorized by a bot label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale issues that have not been addressed in a while; categorized by a bot
Projects
None yet
Development

No branches or pull requests

2 participants