Skip to content

Commit b71b44c

Browse files
committed
check input channel
1 parent c1638c5 commit b71b44c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tf2onnx/onnx_opset/nn.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ def version_1(cls, ctx, node, **kwargs):
284284
if len(kernel_shape) != 4:
285285
raise ValueError("only Conv2D is supported")
286286
k_h, k_w, k_input_channels, k_channel_multiplier = kernel_shape
287+
if k_input_channels < 1:
288+
raise ValueError("input channel must be positive")
287289
k_output_channels = k_input_channels * k_channel_multiplier
288290

289291
node.set_attr("kernel_shape", [k_h, k_w])

0 commit comments

Comments
 (0)