Onnx2tf

Latest version: v1.27.1

Safety actively analyzes 723177 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 51 of 86

1.5.34

- `Softmax`
- Significantly improved efficiency of automatic correction of inference errors.
- Reduce the process of obtaining tensors for error verification by dummy inference in ONNX to once for the entire model
- Installation of `onnxruntime` is mandatory after this release.
- `Pow`
- Suppresses inference errors.
- `common_functions.py`
- Fixed to skip comparing tensors of type `bool` when verifying accuracy.
![image](https://user-images.githubusercontent.com/33194443/215308607-2bf76648-b2e8-4e4f-b47c-170bb1e81b59.png)
- Extended SWAP size for CI from 10GB to 12GB
- `test_model_convert.py`
- Fixed to delete *.tflite generated during testing to avoid CI becoming disk full
- [Implementation of strict mode 145](https://github.com/PINTO0309/onnx2tf/issues/145)
- [[MobileFormer] Converted model outputs values mismatch with original ones. 105](https://github.com/PINTO0309/onnx2tf/issues/105)
- [[MobileFormer]Dimensions must be equal [Add Layer] 103](https://github.com/PINTO0309/onnx2tf/issues/103)
- [`Softmax` Detect conversion errors in axis and identify the axis with the smallest possible error and replace it. 152](https://github.com/PINTO0309/onnx2tf/pull/152)

What's Changed
* Remove unnecessary logic by PINTO0309 in https://github.com/PINTO0309/onnx2tf/pull/153
* Significantly improved efficiency of automatic correction of inference errors. by PINTO0309 in https://github.com/PINTO0309/onnx2tf/pull/154


**Full Changelog**: https://github.com/PINTO0309/onnx2tf/compare/1.5.33...1.5.34

1.5.33

- `Softmax`
- Detect conversion errors in `axis` and identify the `axis` with the smallest possible error and replace it.
- Automatic selection of the axis with the smallest error by measuring the error of all axes in the process of model transformation.
- Because the minimum inference is performed multiple times, the conversion speed of the model including `Softmax` is slightly slower, instead of no longer incurring an accuracy error.
- Almost eliminates conversion errors in `Softmax` operations in Transformer models that contain a large number of `Softmax`, such as `MobileFormer`.
- This implementation can be applied to various OPs that handle `axis`. For example, `ReduceXX`, `ArgMax`.
- The sample JSON file was modified to reflect this improvement. https://github.com/PINTO0309/onnx2tf/blob/main/json_samples/replace_MobileFormer-e9.json

![image](https://user-images.githubusercontent.com/33194443/215254557-6e007bf3-036a-41c0-a4d9-e5ef481b0158.png)

[Implementation of strict mode 145](https://github.com/PINTO0309/onnx2tf/issues/145)
[[MobileFormer] Converted model outputs values mismatch with original ones. 105](https://github.com/PINTO0309/onnx2tf/issues/105)
[[MobileFormer]Dimensions must be equal [Add Layer] 103](https://github.com/PINTO0309/onnx2tf/issues/103)

What's Changed
* `Softmax` Detect conversion errors in axis and identify the axis with the smallest possible error and replace it. by PINTO0309 in https://github.com/PINTO0309/onnx2tf/pull/152


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

1.5.32

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.


2. `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
---|---
![image](https://user-images.githubusercontent.com/33194443/214461349-c7c7586f-9529-41a6-a52e-54f6d20cfc15.png) | ![Screenshot from 2023-01-25 13-58-54](https://user-images.githubusercontent.com/34959032/214483588-82181941-8911-40ad-9964-40459a2a0d10.png)

3. Issue number (only if there is a related issue)
135 139 143

What's Changed
* `AveragePool` bug fix & `onnx_tf_tensor_validation` logic 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

1.5.31

- `AveragePool`, `MaxPool`
- `MaxPool` padding insertion logic is updated same as `AveragePool`.
- Dilated `MaxPool` 1D with strided fixed, 3D and above is disabled.
- `average_multiplier` in `AveragePool.py` is used only for appropriate tensors to fix bug mentioned in https://github.com/PINTO0309/onnx2tf/pull/143.
After this fix, tensors after `AveragePool` now have correct shape as below.

Before | After
---|---
<img src="https://user-images.githubusercontent.com/34959032/214453024-abdacd6e-c1cb-4c91-b866-68433ec75781.png" height="400"> | <img src="https://user-images.githubusercontent.com/34959032/214453071-5fe35461-5878-4962-bbad-c0f60e40e586.png" height="400">

What's Changed
* MaxPool padding insertion logic update by Hyunseok-Kim0 in https://github.com/PINTO0309/onnx2tf/pull/138


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

1.5.30

- Fixed Abort problem on Keras (.h5) output when using `np.dtype`
- [[YOLOX-X] Error when outputting to h5 file. AttributeError: 'numpy.dtype[int64]' object has no attribute 'item' 146](https://github.com/PINTO0309/onnx2tf/issues/146)
- [[MobileFormer] Converted model outputs values mismatch with original ones. 105](https://github.com/PINTO0309/onnx2tf/issues/105)
- [[MobileFormer]Dimensions must be equal [Add Layer] 103](https://github.com/PINTO0309/onnx2tf/issues/103)

- Fixed NMS error when outputting to Keras (.h5)
- https://s3.ap-northeast-2.wasabisys.com/temp-models/onnx2tf_146/yolox_x.onnx
- https://github.com/PINTO0309/onnx2tf/releases/download/1.1.28/faster_rcnn-10.onnx
- https://github.com/PINTO0309/onnx2tf/releases/download/1.1.28/yolov7_tiny_head_0.768_post_480x640.onnx

onnx2tf -i yolox_x.onnx -oh5


ValueError: This Keras op layer was generated from <function non_max_suppression at 0x7fd6a96ff1f0>,
a method that is not publicly exposed in the TensorFlow API.
This may have happened if the method was explicitly decorated to add dispatching support,
and it was used during Functional model construction.
To ensure cross-version compatibility of Keras models that use op layers,
only op layers produced from public TensorFlow API symbols can be serialized.

- Define NMS layers to avoid problems
- [[YOLOX-X] Error when outputting to h5 file. AttributeError: 'numpy.dtype[int64]' object has no attribute 'item' 146](https://github.com/PINTO0309/onnx2tf/issues/146)
- [[YOLOX-X] TensorFlow aborts when exporting a model with NMS to Keras (.h5) 150](https://github.com/PINTO0309/onnx2tf/issues/150)
![image](https://user-images.githubusercontent.com/33194443/213971181-916ddedb-73ca-4150-92f0-da9406dcf8fd.png)
![image](https://user-images.githubusercontent.com/33194443/213971509-85f1c463-e530-4c8b-af01-2c54a2921400.png)
![image](https://user-images.githubusercontent.com/33194443/213971942-cc76c663-415a-4384-b9b2-57aea9a06c57.png)
![image](https://user-images.githubusercontent.com/33194443/213972335-4463f9c1-7d90-47be-b1bc-e16d67451223.png)

What's Changed
* Fixed Abort problem on Keras (.h5) output when using `np.dtype` by PINTO0309 in https://github.com/PINTO0309/onnx2tf/pull/148
* Fixed NMS error when outputting to Keras (.h5) by PINTO0309 in https://github.com/PINTO0309/onnx2tf/pull/149


**Full Changelog**: https://github.com/PINTO0309/onnx2tf/compare/1.5.29...1.5.30

1.5.29

- Fixed to generate a tflite file with the same name as the input onnx file
![image](https://user-images.githubusercontent.com/33194443/213948279-d620fa86-ef5f-4709-83e8-492931a0a37c.png)

What's Changed
* Fixed to generate a tflite file with the same name as the input onnx file by PINTO0309 in https://github.com/PINTO0309/onnx2tf/pull/147


**Full Changelog**: https://github.com/PINTO0309/onnx2tf/compare/1.5.28...1.5.29

Page 51 of 86

Links

Releases

Has known vulnerabilities

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.