onnx2torch icon indicating copy to clipboard operation
onnx2torch copied to clipboard

Changing conv input tensors from 'Constant' to 'Initializer' and populating the graph initializer

Open ecenurustun opened this issue 5 months ago • 0 comments

I have a previously exported model (<path_to_file>/model.onnx) and after loading it I realized that its graph initializer list (model.graph.initializer) is empty because weights of Conv layers are somehow saved as "Constant" instead of "Initializer". Please see the Netron screenshot below for one such tensor. And onnx2torch fails because converter will iterate over the empty initializer list. So my question is, how can I add these tensors to graph initializer? I can access their names through node.input[1] but how about their values? Will it require onnxruntime? Thank you.

(I asked this question here too in case someone already has a solution.)

weight

ecenurustun avatar Sep 30 '24 20:09 ecenurustun