Onnx2tf

Latest version: v1.27.1

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

Scan your dependencies

Page 43 of 86

1.7.29

- Fixed lack of sanitizing of OP names when outputting INT8 models

What's Changed
* Fixed lack of sanitizing of OP names when outputting INT8 models by PINTO0309 in https://github.com/PINTO0309/onnx2tf/pull/252


**Full Changelog**: https://github.com/PINTO0309/onnx2tf/compare/1.7.28...1.7.29

1.7.28

- `Add`, `Sub`, `Div`, `Mul`, `Mod`
- Fixed a problem with the `shape_unmatched_special_avoidance_workaround` judgment condition to improve the Transformer conversion success rate.
- Ref: https://github.com/zhangyi-3/KBNet
![image](https://user-images.githubusercontent.com/33194443/225509951-823496c5-bb82-4cf4-91d8-f8cd326d9fea.png)

What's Changed
* Fixed a problem with the `shape_unmatched_special_avoidance_workaround` judgment condition to improve the Transformer conversion success rate. by PINTO0309 in https://github.com/PINTO0309/onnx2tf/pull/250


**Full Changelog**: https://github.com/PINTO0309/onnx2tf/compare/1.7.27...1.7.28

1.7.27

- Improved INT8 quantization to be performed based on `saved_model` signature information
- Ref: https://www.tensorflow.org/lite/performance/post_training_quantization#full_integer_quantization
- Improved matching of the input OP name specified in the dataset for calibration with the input OP name in the signature to prevent input order discrepancies.
- When quantizing INT8 for models with multiple inputs, you no longer need to be aware of the order in which the calibration data sets are specified.
- Only when performing INT8 quantization, the `saved_model` signature information of the converted model is displayed in the log as reference information, as shown in the figure below.
![image](https://user-images.githubusercontent.com/33194443/225372379-6bc5194d-4170-469a-a697-96b28b32bd25.png)
- The input OP name in ONNX and the input OP name after conversion to `saved_model` may mismatch. This is due to automatic sanitization of strings that cannot be used in the input OP name of `saved_model`. e.g. `:`, `/`
- [[BERT-Squad] INT8 quantization: The input data type must be Float32. 248](https://github.com/PINTO0309/onnx2tf/issues/248)

What's Changed
* Improved INT8 quantization to be performed based on `saved_model` signature information by PINTO0309 in https://github.com/PINTO0309/onnx2tf/pull/249


**Full Changelog**: https://github.com/PINTO0309/onnx2tf/compare/1.7.26...1.7.27

1.7.26

- `Add`, `Sub`, `Mul`, `Div`, `Mod`
- [Experimental] Deterring shape corruption due to broadcast. Transformer conversion stability improvement. (3D and below only)
- While it is not possible to prevent accuracy degradation after conversion, it is possible to avoid processing interruptions due to conversion errors as much as possible.

What's Changed
* [Experimental] Deterring shape corruption due to broadcast. Transformer conversion stability improvement. (3D and below only) by PINTO0309 in https://github.com/PINTO0309/onnx2tf/pull/247


**Full Changelog**: https://github.com/PINTO0309/onnx2tf/compare/1.7.25...1.7.26

1.7.25

- `CumSum`
- TensorFlow's `tf.math.cumsum` does not support boolean, so temporarily cast to INT32 for calculation.
- [[PARSeq] Conversion from ONNX to Tensorflow 245](https://github.com/PINTO0309/onnx2tf/issues/245)
- https://s3.ap-northeast-2.wasabisys.com/temp-models/onnx2tf_245/parseq.onnx

What's Changed
* TensorFlow's tf.math.cumsum does not support boolean, so temporarily cast to INT32 for calculation. `CumSum` by PINTO0309 in https://github.com/PINTO0309/onnx2tf/pull/246


**Full Changelog**: https://github.com/PINTO0309/onnx2tf/compare/1.7.24...1.7.25

1.7.24

- `ConvTranspose`
- Fixed out-of-range reference errors for begin and end when executing `Slice` for padding removal after `ConvTranspose` generation.
- If `begin` or `end` is an irregular padding size, focusing only on `begin` and the maximum size of the tensor will break the tensor.
- Modified to remove padding from only before the tensor, only after the tensor, or both before and after, depending on the padding size of `begin` and `end`.

error: 'tf.Slice' op requires 0 <= begin[i] <= begin[i] + size[i] <= Di


loc(fused["Slice:", callsite("model/tf.slice/Slice"("/usr/local/lib/python3.8/dist-packages/keras/engine/training.py":558:0) at callsite("/usr/local/lib/python3.8/dist-packages/keras/utils/traceback_utils.py":65:0 at callsite("/home/xxxx/git/onnx2tf/onnx2tf/onnx2tf.py":812:0 at callsite("/usr/local/lib/python3.8/dist-packages/tensorflow/python/autograph/core/function_wrappers.py":113:0 at callsite("/home/xxxx/git/onnx2tf/onnx2tf/onnx2tf.py":812:0 at callsite("/usr/local/lib/python3.8/dist-packages/tensorflow/python/framework/func_graph.py":1189:0 at callsite("/usr/local/lib/python3.8/dist-packages/tensorflow/python/eager/polymorphic_function/polymorphic_function.py":667:0 at callsite("/usr/local/lib/python3.8/dist-packages/tensorflow/python/framework/func_graph.py":1214:0 at callsite("/usr/local/lib/python3.8/dist-packages/tensorflow/python/eager/polymorphic_function/tracing_compiler.py":300:0 at "/usr/local/lib/python3.8/dist-packages/tensorflow/python/eager/polymorphic_function/tracing_compiler.py":396:0)))))))))]): error: 'tf.Slice' op requires 0 <= begin[i] <= begin[i] + size[i] <= Di
[E] No function: __iter__ registered for opset: 13
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/xxxx/.vscode/extensions/ms-python.python-2023.4.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/__main__.py", line 39, in <module>
cli.main()
File "/home/xxxx/.vscode/extensions/ms-python.python-2023.4.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 430, in main
run()
File "/home/xxxx/.vscode/extensions/ms-python.python-2023.4.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 284, in run_file
runpy.run_path(target, run_name="__main__")
File "/home/xxxx/.vscode/extensions/ms-python.python-2023.4.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 321, in run_path
return _run_module_code(code, init_globals, run_name,
File "/home/xxxx/.vscode/extensions/ms-python.python-2023.4.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 135, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/home/xxxx/.vscode/extensions/ms-python.python-2023.4.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 124, in _run_code
exec(code, run_globals)
File "/home/xxxx/git/onnx2tf/onnx2tf/onnx2tf.py", line 1913, in <module>
main()
File "/home/xxxx/git/onnx2tf/onnx2tf/onnx2tf.py", line 1867, in main
model = convert(
File "/home/xxxx/git/onnx2tf/onnx2tf/onnx2tf.py", line 875, in convert
tflite_model = converter.convert()
File "/usr/local/lib/python3.8/dist-packages/tensorflow/lite/python/lite.py", line 1897, in convert
return super(TFLiteConverterV2, self).convert()
File "/usr/local/lib/python3.8/dist-packages/tensorflow/lite/python/lite.py", line 962, in wrapper
return self._convert_and_export_metrics(convert_func, *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/tensorflow/lite/python/lite.py", line 940, in _convert_and_export_metrics
result = convert_func(self, *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/tensorflow/lite/python/lite.py", line 1546, in convert
return super(TFLiteFrozenGraphConverterV2,
File "/usr/local/lib/python3.8/dist-packages/tensorflow/lite/python/lite.py", line 1166, in convert
result = _convert_graphdef(
File "/usr/local/lib/python3.8/dist-packages/tensorflow/lite/python/convert_phase.py", line 212, in wrapper
raise converter_error from None Re-throws the exception.
File "/usr/local/lib/python3.8/dist-packages/tensorflow/lite/python/convert_phase.py", line 205, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/tensorflow/lite/python/convert.py", line 817, in convert_graphdef
data = convert(
File "/usr/local/lib/python3.8/dist-packages/tensorflow/lite/python/convert.py", line 322, in convert
raise converter_error
tensorflow.lite.python.convert_phase.ConverterError: /usr/local/lib/python3.8/dist-packages/keras/engine/training.py:558:0: error: 'tf.Slice' op requires 0 <= begin[i] <= begin[i] + size[i] <= Di
/usr/local/lib/python3.8/dist-packages/keras/utils/traceback_utils.py:65:0: note: called from
/home/xxxx/git/onnx2tf/onnx2tf/onnx2tf.py:812:0: note: called from
/usr/local/lib/python3.8/dist-packages/tensorflow/python/autograph/core/function_wrappers.py:113:0: note: called from
/home/xxxx/git/onnx2tf/onnx2tf/onnx2tf.py:812:0: note: called from
/usr/local/lib/python3.8/dist-packages/tensorflow/python/framework/func_graph.py:1189:0: note: called from
/usr/local/lib/python3.8/dist-packages/tensorflow/python/eager/polymorphic_function/polymorphic_function.py:667:0: note: called from
/usr/local/lib/python3.8/dist-packages/tensorflow/python/framework/func_graph.py:1214:0: note: called from
/usr/local/lib/python3.8/dist-packages/tensorflow/python/eager/polymorphic_function/tracing_compiler.py:300:0: note: called from
/usr/local/lib/python3.8/dist-packages/tensorflow/python/eager/polymorphic_function/tracing_compiler.py:396:0: note: called from

- [MSPFN](https://github.com/kuijiang94/MSPFN)
- https://s3.ap-northeast-2.wasabisys.com/temp-models/onnx2tf_243/mspfn_320x480.onnx


ssc4onnx -if mspfn_320x480.onnx

┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ OP Type ┃ OPs ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Add │ 438 │
│ Concat │ 59 │
│ Conv │ 260 │
│ ConvTranspose │ 121 │
│ GlobalAveragePool │ 51 │
│ Min │ 273 │
│ Mul │ 333 │
│ Relu │ 273 │
│ Sigmoid │ 60 │
│ Split │ 3 │
│ Sub │ 1 │
│ Tanh │ 6 │
│ Transpose │ 7 │
│ ---------------------- │ ---------- │
│ Total number of OPs │ 1885 │
│ ====================== │ ========== │
│ Model Size │ 403.2MiB │
└────────────────────────┴────────────┘
INFO: file: mspfn_320x480.onnx
INFO: producer: tf2onnx 1.13.0 2c1db5
INFO: opset: 13
INFO: input_name.1: input shape: [1, 3, 320, 480] dtype: float32
INFO: output_name.1: sub shape: [1, 320, 480, 3] dtype: float32

![image](https://user-images.githubusercontent.com/33194443/224526412-7c8ea707-b30a-4bfb-83cd-d2e777dd097c.png)

![image](https://user-images.githubusercontent.com/33194443/224526343-608dbfa5-04e2-4ea4-a3ae-983003565da5.png)

What's Changed
* Fixed out-of-range reference errors for begin and end when executing `Slice` for padding removal after `ConvTranspose` generatio by PINTO0309 in https://github.com/PINTO0309/onnx2tf/pull/243


**Full Changelog**: https://github.com/PINTO0309/onnx2tf/compare/1.7.23...1.7.24

Page 43 of 86

Links

Releases

Has known vulnerabilities

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.