Skip to content

Commit c6358ec

Browse files
committed
set ir based on opset
1 parent d5bb838 commit c6358ec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tf2onnx/graph.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,10 @@ def make_model(self, graph_doc, optimize=False, graph_name="tf2onnx", **kwargs):
10401040
model_proto = helper.make_model(graph, **kwargs)
10411041

10421042
# set the IR version based on opset
1043-
model_proto.ir_version = constants.OPSET_TO_IR_VERSION.get(self.opset, model_proto.ir_version)
1043+
try:
1044+
model_proto.ir_version = constants.OPSET_TO_IR_VERSION.get(self.opset, model_proto.ir_version)
1045+
except:
1046+
logger.error("ir_version override failed - install the latest onnx version")
10441047

10451048
# optimize the model proto.
10461049
# TODO: this is disabled by default because of bugs in fuse_consecutive_transposes

0 commit comments

Comments
 (0)