From 49d297c081ce7b99c73a74522f1e92ab137c8e14 Mon Sep 17 00:00:00 2001 From: triplemu Date: Mon, 8 Jul 2024 14:17:23 +0800 Subject: [PATCH] fallback C.simplify ir_version error to simplify_path --- onnxsim/onnx_simplifier.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onnxsim/onnx_simplifier.py b/onnxsim/onnx_simplifier.py index 27f6594..528b26f 100644 --- a/onnxsim/onnx_simplifier.py +++ b/onnxsim/onnx_simplifier.py @@ -209,7 +209,7 @@ def parse_size(size: str) -> int: check_ok = model_checking.compare( model_opt, model, check_n, test_input_shapes, input_data, custom_lib ) - except ValueError: + except (ValueError, onnx.onnx_cpp2py_export.checker.ValidationError): print("[bold magenta]Simplified model larger than 2GB. Trying to save as external data...[/bold magenta]") # large models try to convert through a temporary file with tempfile.TemporaryDirectory() as tmpdirname: