From fe7114925e3e33b1c2d3b591a85e9501745161ff Mon Sep 17 00:00:00 2001 From: pinto0309 Date: Tue, 30 Apr 2024 14:23:36 +0900 Subject: [PATCH] Fix to preserve domain and ir_version --- sam4onnx/__init__.py | 2 +- sam4onnx/onnx_attr_const_modify.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sam4onnx/__init__.py b/sam4onnx/__init__.py index 79cbb26..367383e 100644 --- a/sam4onnx/__init__.py +++ b/sam4onnx/__init__.py @@ -1,3 +1,3 @@ from sam4onnx.onnx_attr_const_modify import modify, main -__version__ = '1.0.14' +__version__ = '1.0.15' diff --git a/sam4onnx/onnx_attr_const_modify.py b/sam4onnx/onnx_attr_const_modify.py index b8f9c08..70c30da 100644 --- a/sam4onnx/onnx_attr_const_modify.py +++ b/sam4onnx/onnx_attr_const_modify.py @@ -301,6 +301,10 @@ def modify( if node.domain not in ONNX_STANDARD_DOMAINS ] + # domain, ir_version + domain: str = onnx_graph.domain + ir_version: int = onnx_graph.ir_version + graph = gs.import_onnx(onnx_graph) # Check if Graph contains a custom domain (custom module) @@ -436,7 +440,7 @@ def modify( # Cleanup graph.cleanup().toposort() - modified_graph = gs.export_onnx(graph) + modified_graph = gs.export_onnx(graph, do_type_check=False, **{'domain': domain, 'ir_version': ir_version}) # Optimize new_model = None