Skip to content

Commit fa7ff10

Browse files
committed
catch more eception
1 parent 907a017 commit fa7ff10

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

onnx_diagnostic/helpers/ort_session.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ def __init__(
108108
session_options,
109109
providers=providers,
110110
)
111-
except onnxruntime.capi.onnxruntime_pybind11_state.Fail as e:
111+
except (
112+
onnxruntime.capi.onnxruntime_pybind11_state.Fail,
113+
onnxruntime.capi.onnxruntime_pybind11_state.InvalidGraph,
114+
) as e:
112115
if isinstance(sess, onnx.ModelProto):
113116
debug_path = "_debug_InferenceSession_last_failure.onnx"
114117
onnx.save(

0 commit comments

Comments
 (0)