Skip to content

Commit f05e36d

Browse files
committed
fix bug: sometimes the shape info is missing
1 parent 72ef2d3 commit f05e36d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tf2onnx/onnx_opset/nn.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ def conv_convert_inputs(ctx, node, with_kernel=False, new_kernel_shape=None,
6666
transpose.set_attr("perm", constants.NHWC_TO_NCHW)
6767
transpose.skip_conversion = True
6868
shape = ctx.get_shape(input_name)
69-
new_shape = spatial_map(shape, constants.NHWC_TO_NCHW)
70-
ctx.set_shape(transpose.output[0], new_shape)
69+
if shape is not None:
70+
new_shape = spatial_map(shape, constants.NHWC_TO_NCHW)
71+
ctx.set_shape(transpose.output[0], new_shape)
7172
parent.data_format = "NCHW"
7273

7374
# kernel must to be transposed

tf2onnx/tfonnx.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ def rewrite_incomplete_type_support_rs6(g, ops):
475475
"Div",
476476
"Greater",
477477
"IsNaN",
478+
"Min",
478479
"ReduceSum",
479480
"Slice",
480481
"Split",

0 commit comments

Comments
 (0)