mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-06 00:03:22 +00:00
quantise: Don't error when initializer graph input is missing (#1872)
ONNX IR version 4 and above do not require graph initializers to have corresponding graph inputs.
This commit is contained in:
parent
e361174f78
commit
df472cbfbd
1 changed files with 3 additions and 2 deletions
|
|
@ -309,9 +309,10 @@ class ONNXQuantizer:
|
|||
# Removing input weight to a convolution
|
||||
try:
|
||||
weight_input = next(val for val in self.model.graph.input if val.name == weight.name)
|
||||
self.model.graph.input.remove(weight_input)
|
||||
except StopIteration:
|
||||
raise ValueError('invalid weight name {} found in the graph '.format(weight.name))
|
||||
self.model.graph.input.remove(weight_input)
|
||||
if self.model.ir_version < 4:
|
||||
raise ValueError('invalid weight name {} found in the graph (not a graph input) '.format(weight.name))
|
||||
|
||||
|
||||
def _update_graph(self, weight):
|
||||
|
|
|
|||
Loading…
Reference in a new issue