Skip to content

Conv3DTranspose with strides leads to wrong output dimensions if data format is channels_first #1714

Open
@fthielke

Description

@fthielke

Describe the bug
When converting a model containing Conv3DTranspose with strides > 1 and data_format='channes_first', the output of the resulting ONNX model has the wrong shape (seems to be off by one).

Urgency
Not very high.

Can be easily worked around by using data format channels_last and adding transpose operations which are removed by the optimizer anyhow; adding the workaround each time is annoying, though.

System information

  • OS Platform and Distribution: Windows 10
  • Tensorflow Version: 2.6.0
  • Python version: 3.9.6

To Reproduce
The attached Jupyter notebook test_convtranspose.ipynb.gz creates a simple model containing only a Conv3DTranspose with kernel size (3,3,3) and strides (2,2,2), either using data_format='channes_first' or 'channels_last'.

For the model using 'channels_last', the converted ONNX model correctly doubles its input shape. The other model however does not: e.g. for an input of size (8,8,8), the output size is (16,16,17).

Metadata

Metadata

Assignees

Labels

bugAn unexpected problem or unintended behaviorcontribution welcomeCommunity contribution is welcomed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions