Skip to content

Commit

Permalink
add onnx checker
Browse files Browse the repository at this point in the history
  • Loading branch information
zhreshold committed May 8, 2019
1 parent e157728 commit 59601d3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions python/tvm/relay/frontend/onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,13 @@ def from_onnx(model,
params : dict of str to tvm.NDArray
The parameter dict to be used by relay
"""
try:
from onnx import checker
if hasattr(checker, 'check_model'):
# try use onnx's own model checker before converting any model
checker.check_model(model)
except ImportError:
pass
g = GraphProto(shape, dtype)
graph = model.graph
try:
Expand Down

0 comments on commit 59601d3

Please sign in to comment.