diff --git a/ppq/parser/onnxruntime_exporter.py b/ppq/parser/onnxruntime_exporter.py index 7f37f5c3..6a9a5e9e 100644 --- a/ppq/parser/onnxruntime_exporter.py +++ b/ppq/parser/onnxruntime_exporter.py @@ -587,7 +587,11 @@ def export(self, file_path: str, graph: BaseGraph, for key, value in extra_opsets.items(): op = onnx.OperatorSetIdProto() - op.domain = key + # PATCH 2024.01.30 + # 我也不知道为什么 onnx checker 会对 ai.onnx 这个 domain 报错 + # 按照规范 ai.onnx 与 "" 是等价的写法 + if key == 'ai.onnx': key = "" + op.domain = key op.version = value opsets.append(op) @@ -613,4 +617,4 @@ def export(self, file_path: str, graph: BaseGraph, ppq_warning('Exported Onnx Model is not executable, following Op has onnxruntime-unsupported quant policy:') for op in unsupportable_quant_op: ppq_warning(f'{op.name} (bitwidth != 8)') - ppq_warning('For Generating onnxruntime-executable Model, use TargetPlatform = Onnxruntime or OnnxruntimeQuantizer instead.') \ No newline at end of file + ppq_warning('For Generating onnxruntime-executable Model, use TargetPlatform = Onnxruntime or OnnxruntimeQuantizer instead.')