Is there a cannon way to save a ONNX proto inside a TTree (CERN, root-framework) #12992
Unanswered
HenryDayHall
asked this question in
Other Q&A
Replies: 1 comment
-
We neither have nor intend to provide a facility to serialize ORT sessions. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear onnxruntime people,
I've got a number of
.onnx
files on my disk, and I need to store them inside a root file. I know I can save an load an arbitrary c++ class in a root file (see https://root.cern/manual/io/#generating-streamers) but I'm actually not keen to do that. Streamers create a measurable overhead.I've noticed I can just take all the bytes read from the proto file and write them as a sequence of chars to my root file. Root is then happy to give me a pointer to those chars (guaranteed continuos) and a session can be created from a pointer to that data. I have a toy model that does this nicely, correctly reproducing the output that's created by reading the file straight from disk. But I have no idea if this is going to be very platform dependant.
None of my searches have turned up an example of anyone else storing ONNX sessions in root files. With Streamers or otherwise. Have I missed a good example of this? Does anyone have any tips for me?
Thanks, H
Beta Was this translation helpful? Give feedback.
All reactions