Negative group attribute in generated convolution operations #2084
Labels
bug
An unexpected problem or unintended behavior
contribution welcome
Community contribution is welcomed
Describe the bug
Generated ONNX convolution nodes may get a negative
group
attribute value in certain cases. The graph is generated without errors, but trying to run it causes an error in ONNXRuntime.Urgency
NA
System information
To Reproduce
Screenshots
NA
Additional context
The error seems to be in
tf2onnx.onnx_opset.nn
. The calculation of thegroups
attribute is done as follows:First the number of channels in
node.input[0]
is checked, depending ondata_format
, and then, only if that does not result in-1
, it is divided by the number of input channels innode.input[1]
. However, there is no check to verify that number of channels is actually valid, and not-1
. I suppose the simple fix would be to just check that and leave the attribute as1
if either of the two values is-1
, but I thought I'd leave that decision to someone from the team instead of directly sending a PR.The text was updated successfully, but these errors were encountered: