Skip to content

centerNet exported ONNX seems not correct #1659

@ttyio

Description

@ttyio

Describe the bug
The exported ONNX for centerNet ( http://download.tensorflow.org/models/object_detection/tf2/20210210/centernet_mobilenetv2fpn_512x512_coco17_kpts.tar.gz ) seems not correct.

For the original model:
we are trying to mark NaN as 0 in the sqrt output.
image

For the exported onnx:
seems we are fill the sqrt output with NaNs.
See below image when I tried to apply the below formulas:

  • Sqrt(Negative) = NaN
  • 0 * NaN = NaN
  • 0 * Inf = NaN
  • 1 * Inf = Inf
  • a + NaN = NaN (a is normalized number in IEEE 754)
  • Inf + NaN = NaN

image

Urgency
N/A

System information

  • Linux Ubuntu 18.04
  • Tensorflow Version: 2.5.0
  • Python version: 3.6.9

To Reproduce
python3 -m pip install tensorflow onnxruntime
python3 -m pip install git+https://github.com/onnx/tensorflow-onnx

download http://download.tensorflow.org/models/object_detection/tf2/20210210/centernet_mobilenetv2fpn_512x512_coco17_kpts.tar.gz

python3 -m tf2onnx.convert --saved-model centernet_mobilenetv2_fpn_kpts/saved_model/ --opset 13 --output centernet_mobilenetv2_fpn_kpts.onnx

using Netron to visualize the onnx.

Screenshots
N/A

Additional context
N/A

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