There is a newer version of the record available.

Published September 25, 2022 | Version 1.5.32

Tools to convert ONNX files (NCHW) to TensorFlow format (NHWC)

Authors/Creators

Description

1. Summary of corrections
  1. AveragePool bug fix There was a bug while converting pidnet_S_cityscapes_192x320.onnx to tensorflow. When pooling kernel is larger than padding + tensor shape, wrong average_multiplier was used. As shown below, first pooling takes total 9 elements. But the number of effective elements is 3 because end side of padding is also included in kernel. So, average_multiplier should be 9 / 3, not 9 / (9 - 4).

<img src="https://user-images.githubusercontent.com/34959032/214485451-d9ffcf7f-1ac7-4571-8375-d4550cdbf054.png" height="200"> Calculation logic for average_multiplier is changed when the effective tensor size is smaller than kernel to fix this problem.

  1. onnx_tf_tensor_validation logic change onnx_tf_tensor_validation is now compare corresponding onnx output and tensorflow output. Tensorflow output node name is stored in tf_layers_dict while converting onnx graph to tensorflow model. I changed onnx_tf_tensor_validation to use that information for more accurate comparison.
2. Before/After (If there is an operating log that can be used as a reference)

https://github.com/PINTO0309/onnx2tf/releases/download/1.1.28/pidnet_S_cityscapes_192x320.onnx Before | After ---|--- <img src="https://user-images.githubusercontent.com/34959032/214453071-5fe35461-5878-4962-bbad-c0f60e40e586.png" height="400"> | <img src="https://user-images.githubusercontent.com/34959032/214483743-de4f10bc-c14e-4df9-bbb0-4bf05474671a.png" height="400">

Before After
3. Issue number (only if there is a related issue) 135 #139 #143 What's Changed

Full Changelog: https://github.com/PINTO0309/onnx2tf/compare/1.5.31...1.5.32

Notes

If you use onnx2tf in your research, please cite it using these metadata.

Files

PINTO0309/onnx2tf-1.5.32.zip

Files (450.0 kB)

Name Size Download all
md5:5fbeb39401909549049636b78eb6867d
450.0 kB Preview Download

Additional details

Related works