Skip to content

tranpose optimization for hardswish in tensorflow-lite #1816

Open
@Xiadalei

Description

@Xiadalei

Describe the bug
When convering a tensorflow lite model with hardswish, specifically TFL_HARD_SWISH operator. There's tranpose wrapper around the hardswish operator.

before conversion
图片

after conversion
图片

Urgency
none

System information

  • OS Platform and Distribution: Linux Ubuntu 20.04
  • Tensorflow Version: 2.6.0
  • Python version: 3.8.10

To Reproduce

Just use offical mobileV3 model or use the model below
v3-small_224_1.0_float.tflite.zip
with command line
python -m tf2onnx.convert --tflite ./v3-small_224_1.0_float.tflite --inputs-as-nchw input --opset 14 --output ./v3.onnx

And the model converted is
v3.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    need investigationNeed investigationtfliteIssues related to TensorFlow Lite

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions