tf2onnx conversion of model with conv1d layers with group parameter set

77 Views Asked by At

I tried to convert a tensorflow model containing conv1d layers with 'groups' parameter > 2, to onnx using tf2onnx. When I tried to read the onnx model us onnxruntime, I get the below error,

This is an invalid model. In Node, ("sequential/conv1d/PartitionedCall", PartitionedCall, "", -1) : ("conv1d_input": tensor(float),"sequential/conv1d/ReadVariableOp:0": tensor(float),) -> ("sequential/conv1d/PartitionedCall:0",) , Error No Op registered for PartitionedCall with domain_version of 15

The same conversion works when the 'groups' parameter is not set in the tensorflow conv1d layers.

I wonder if this is a compatibility issue with onnx.

1

There are 1 best solutions below

0
Vikas Sharma On

As you can check issue#1864 is still open. So, the TensorFlow op PartitionedCall is unsupported for opset 15. Take a look at the troubleshooting page when you face the issue tensorflow op is not supported.

Now, at line#46 of Conv1D class in Keras it is mentioned that:

  • Input channels and filters must both be divisible by groups.

So, just make sure this is not the problem here - as you mentioned:

The same conversion works when the 'groups' parameter is not set in the tensorflow conv1d layers.

This means the groups parameter is then implicitly set to the default value 1 and therefore Input channels and filters are divisible by groups.

Finally, make sure to use the largest opset compatible with your application and check the ONNX opset support for compatibility which might be the actual culprit here as per your thought:

I wonder if this is a compatibility issue with onnx.