Edit inputs from an ONNX model #12326
Unanswered
IzanCatalan
asked this question in
Other Q&A
Replies: 1 comment
-
You can write them directly (I mean change data member like data_type, raw_data etc. of initializer). For example, we have a tool to convert model from float32 to float16. That need change initializers of float32. Related code: onnxruntime/onnxruntime/python/tools/transformers/float16.py Lines 68 to 83 in bdd6b00 |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all!, Does anyone know how to edit inputs from an onnx model in python?
I would like to change for exameple one element of an input tensor (like weights in a convolution layer) in one node of the graph. I tried to do it with " model = onnx.load ()" and after with "inputs = model.graph.initializers" but when I get de inputs, I can read them but not write them, they're read only.
is there any way to write them, using another tool for instance? Thanks.
Beta Was this translation helpful? Give feedback.
All reactions