Loading onnx file with external data via CreateSessionFromArray or equivalent #18087
Unanswered
prsmendonca
asked this question in
Other Q&A
Replies: 1 comment 2 replies
-
See onnxruntime/include/onnxruntime/core/session/onnxruntime_c_api.h Lines 3488 to 3490 in 8e6019a |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a model that was converted to onnx, and because its size is larger than 2 GB it was split into .onnx and .onnx.data files. I'd like to load the data from the .onnx and the .onnx.data files into buffers, and the reconstitute the original model in memory. Is that possible? A somewhat in-between solution where I'd load the .onnx file into a buffer and read the contents of the .onnx.data file from a path would be acceptable, although much less desirable. I'm mentioning this option mainly because it seems there is a Python equivalent to it via
onnx.external_data_helper
, but I could not find a C/C++ equivalent.Note that for a simple .onnx file, without external data, OrtApi::CreateSessionFromArray does something similar to what I want, and I have that working for smaller models. For a different use case, also with a large model with external data, I can use OrtApi::CreateSession with the path of the .onnx file alone, and that works too. But in the current use case I specifically need to load the contents of the files into memory, a la OrtApi::CreateSessionFromArray or equivalent.
Beta Was this translation helpful? Give feedback.
All reactions