Skip to content

Commit

Permalink
修正了一个 onnx domain 的相关问题
Browse files Browse the repository at this point in the history
新的 onnx checker 会对 ai.onnx 这个 domain 报错,这个补丁将其修改为 ""
  • Loading branch information
ZhangZhiPku authored Jan 30, 2024
1 parent 95c34be commit 74056fe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ppq/parser/onnxruntime_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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.')
ppq_warning('For Generating onnxruntime-executable Model, use TargetPlatform = Onnxruntime or OnnxruntimeQuantizer instead.')

0 comments on commit 74056fe

Please sign in to comment.