Skip to content

DepthwiseConv2d translation adds Reshape and Transpose operators to the kernel that are invalid  #1070

@NikolasMarkou

Description

@NikolasMarkou

Describe the bug
When translating the DepthwiseConv2d or DepthwiseConv2dNative operations 2 extra ops are added to the kernel to get into the correct form. These are the Reshape and Transpose operators. These are problematic for the following reasons.

  1. The Transpose order (3, 2, 0, 1) is invalid under certain versions of tensorrt
  2. The Reshape operator is invalid under certain versions of tensorrt (5.1 does not support the int64)
  3. Additional complexity with 2 extra layers per DepthwiseConv2d operator

Urgency
This is urgent and blocker for anybody using the onnx system as a intermediate step towards other runtimes

System information

  • Linux Mint 18.04
  • Tensorflow Version: 1.15
  • Python version: 3.6.9

To Reproduce
Create any DepthwiseConv2dNative or DepthwiseConv2d operator in tensorflow. I use Opset 7 but this is true for any version

Expected behavior
I expected the kernel to be changed/reshaped internally and not use additional operators

Screenshots
Tensorflow
image

Onnx
image

Additional context
My target system is tensorrt 5.1 and tensorrt 7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions