From bc3cbead56f8796b1f14983d7111db2fd46d65f2 Mon Sep 17 00:00:00 2001 From: "Joshua Z. Zhang" Date: Tue, 14 May 2019 17:21:09 -0700 Subject: [PATCH] catch onnx checker error --- python/tvm/relay/frontend/onnx.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/tvm/relay/frontend/onnx.py b/python/tvm/relay/frontend/onnx.py index 4747bed5dfc1a..c9012035ad9e3 100644 --- a/python/tvm/relay/frontend/onnx.py +++ b/python/tvm/relay/frontend/onnx.py @@ -1140,6 +1140,10 @@ def from_onnx(model, checker.check_model(model) except ImportError: pass + except onnx.onnx_cpp2py_export.checker.ValidationError as e: + import warnings + # the checker is a bit violent about errors, so simply print warnings here + warnings.warn(e) g = GraphProto(shape, dtype) graph = model.graph try: