Tools to convert ONNX files (NCHW) to TensorFlow format (NHWC)
Authors/Creators
Description
AveragePoolbug fix There was a bug while converting pidnet_S_cityscapes_192x320.onnx to tensorflow. When pooling kernel is larger than padding + tensor shape, wrongaverage_multiplierwas 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_multipliershould 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.
onnx_tf_tensor_validationlogic changeonnx_tf_tensor_validationis now compare corresponding onnx output and tensorflow output. Tensorflow output node name is stored intf_layers_dictwhile converting onnx graph to tensorflow model. I changedonnx_tf_tensor_validationto use that information for more accurate comparison.
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 |
|---|---|
AveragePoolbug fix &onnx_tf_tensor_validationlogic change by @Hyunseok-Kim0 in https://github.com/PINTO0309/onnx2tf/pull/151
Full Changelog: https://github.com/PINTO0309/onnx2tf/compare/1.5.31...1.5.32
Notes
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
- Is supplement to
- https://github.com/PINTO0309/onnx2tf/tree/1.5.32 (URL)