-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Performance]Why is loading an ONNX model taking so long? #23338
Comments
Without seeing a model, it is hard to say. However, if your model has lots of functions, it may take time to inline them. Optimizations may take time. |
Thanks for your suggestion. Can you provide help on how to optimize it please? |
You try this in C++ (although in Python it is quicker) |
Thank you, I'll try it out |
Is there any way I can share the .onnx file with you? With optimization, it is still taking quite a long time (almost two hours - more than without optimization). |
You can zip it up and put on a cloud provider of your choice. |
Describe the issue
I am using Visual Studio 2022 and onnxruntime downloaded from Manage NuGet Packages. My onnx file of size 915MB (random forest with 500 trees) is taking ages to load using the following code.
To reproduce
#include
#include <onnxruntime_cxx_api.h>
using namespace std;
int main() {
const std::string model_s = "C:/Users/moniq/Downloads/MgarrRFModel.onnx";
std::basic_string<ORTCHAR_T> model = std::basic_string<ORTCHAR_T>(model_s.begin(), model_s.end());
}
Urgency
Urgent
Platform
Windows
OS Version
24h2
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
latest on
ONNX Runtime API
C++
Architecture
X64
Execution Provider
Default CPU
Execution Provider Library Version
No response
Model File
No response
Is this a quantized model?
Yes
The text was updated successfully, but these errors were encountered: