onnx2tf 1.27.10__py3-none-any.whl → 1.28.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- onnx2tf/__init__.py +1 -1
- onnx2tf/onnx2tf.py +398 -19
- onnx2tf/utils/common_functions.py +2 -1
- onnx2tf/utils/iterative_json_optimizer.py +258 -0
- onnx2tf/utils/json_auto_generator.py +1505 -0
- {onnx2tf-1.27.10.dist-info → onnx2tf-1.28.0.dist-info}/METADATA +40 -4
- {onnx2tf-1.27.10.dist-info → onnx2tf-1.28.0.dist-info}/RECORD +12 -10
- {onnx2tf-1.27.10.dist-info → onnx2tf-1.28.0.dist-info}/WHEEL +1 -1
- {onnx2tf-1.27.10.dist-info → onnx2tf-1.28.0.dist-info}/entry_points.txt +0 -0
- {onnx2tf-1.27.10.dist-info → onnx2tf-1.28.0.dist-info}/licenses/LICENSE +0 -0
- {onnx2tf-1.27.10.dist-info → onnx2tf-1.28.0.dist-info}/licenses/LICENSE_onnx-tensorflow +0 -0
- {onnx2tf-1.27.10.dist-info → onnx2tf-1.28.0.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: onnx2tf
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.28.0
|
|
4
4
|
Summary: Self-Created Tools to convert ONNX files (NCHW) to TensorFlow/TFLite/Keras format (NHWC). The purpose of this tool is to solve the massive Transpose extrapolation problem in onnx-tensorflow (onnx-tf).
|
|
5
5
|
Home-page: https://github.com/PINTO0309/onnx2tf
|
|
6
6
|
Author: Katsuya Hyodo
|
|
@@ -32,7 +32,7 @@ Incidentally, I have never used this tool in practice myself since I started wor
|
|
|
32
32
|
<img src="https://user-images.githubusercontent.com/33194443/193840307-fa69eace-05a9-4d93-9c5d-999cf88af28e.png" />
|
|
33
33
|
</p>
|
|
34
34
|
|
|
35
|
-
[](https://pepy.tech/project/onnx2tf)  [](https://img.shields.io/badge/Python-3.8-2BAF2B) [](https://pypi.org/project/onnx2tf/) [](https://github.com/PINTO0309/onnx2tf/actions?query=workflow%3ACodeQL)  [](https://doi.org/10.5281/zenodo.7230085)
|
|
35
|
+
[](https://pepy.tech/project/onnx2tf)  [](https://img.shields.io/badge/Python-3.8-2BAF2B) [](https://pypi.org/project/onnx2tf/) [](https://github.com/PINTO0309/onnx2tf/actions?query=workflow%3ACodeQL)  [](https://doi.org/10.5281/zenodo.7230085) [](https://deepwiki.com/PINTO0309/onnx2tf)
|
|
36
36
|
|
|
37
37
|
## Note
|
|
38
38
|
- The torch.script-based `torch.onnx.export` has already been moved to maintenance mode, and we recommend moving to the FX graph-based `torch.onnx.dynamo_export` starting with PyTorch v2.2.0.
|
|
@@ -334,7 +334,7 @@ Video speed is adjusted approximately 50 times slower than actual speed.
|
|
|
334
334
|
docker run --rm -it \
|
|
335
335
|
-v `pwd`:/workdir \
|
|
336
336
|
-w /workdir \
|
|
337
|
-
ghcr.io/pinto0309/onnx2tf:1.
|
|
337
|
+
ghcr.io/pinto0309/onnx2tf:1.28.0
|
|
338
338
|
|
|
339
339
|
or
|
|
340
340
|
|
|
@@ -342,7 +342,7 @@ Video speed is adjusted approximately 50 times slower than actual speed.
|
|
|
342
342
|
docker run --rm -it \
|
|
343
343
|
-v `pwd`:/workdir \
|
|
344
344
|
-w /workdir \
|
|
345
|
-
docker.io/pinto0309/onnx2tf:1.
|
|
345
|
+
docker.io/pinto0309/onnx2tf:1.28.0
|
|
346
346
|
|
|
347
347
|
or
|
|
348
348
|
|
|
@@ -498,6 +498,22 @@ onnx2tf -i resnet18-v1-7.onnx -okv3
|
|
|
498
498
|
wget https://github.com/PINTO0309/onnx2tf/releases/download/0.0.2/resnet18-v1-7.onnx
|
|
499
499
|
onnx2tf -i resnet18-v1-7.onnx -otfv1pb
|
|
500
500
|
|
|
501
|
+
# Automatic JSON generation only
|
|
502
|
+
# Generates an optimal parameter replacement JSON file for model conversion.
|
|
503
|
+
# The JSON file is saved to {model_name}_auto.json when conversion errors occur
|
|
504
|
+
# or accuracy issues are detected.
|
|
505
|
+
onnx2tf -i model.onnx -agj
|
|
506
|
+
|
|
507
|
+
# Accuracy validation only (no JSON generation)
|
|
508
|
+
# Validates the accuracy between ONNX and TensorFlow outputs without generating
|
|
509
|
+
# any parameter replacement JSON file.
|
|
510
|
+
onnx2tf -i model.onnx -cotof
|
|
511
|
+
|
|
512
|
+
# Accuracy validation + automatic JSON generation
|
|
513
|
+
# First generates an optimal parameter replacement JSON file, then uses it
|
|
514
|
+
# to validate the model accuracy. This ensures the best possible conversion accuracy.
|
|
515
|
+
onnx2tf -i model.onnx -agj -cotof
|
|
516
|
+
|
|
501
517
|
# INT8 Quantization, Full INT8 Quantization
|
|
502
518
|
# INT8 Quantization with INT16 activation, Full INT8 Quantization with INT16 activation
|
|
503
519
|
# Dynamic Range Quantization
|
|
@@ -1590,6 +1606,7 @@ usage: onnx2tf
|
|
|
1590
1606
|
[-coton]
|
|
1591
1607
|
[-cotor CHECK_ONNX_TF_OUTPUTS_ELEMENTWISE_CLOSE_RTOL]
|
|
1592
1608
|
[-cotoa CHECK_ONNX_TF_OUTPUTS_ELEMENTWISE_CLOSE_ATOL]
|
|
1609
|
+
[-agj]
|
|
1593
1610
|
[-dms]
|
|
1594
1611
|
[-uc]
|
|
1595
1612
|
[-n]
|
|
@@ -2025,6 +2042,15 @@ optional arguments:
|
|
|
2025
2042
|
The absolute tolerance parameter.
|
|
2026
2043
|
Default: 1e-4
|
|
2027
2044
|
|
|
2045
|
+
-agj, --auto_generate_json
|
|
2046
|
+
Automatically generates a parameter replacement JSON file that achieves minimal error
|
|
2047
|
+
when converting the model. This option explores various parameter combinations to find
|
|
2048
|
+
the best settings that result in successful conversion and highest accuracy.
|
|
2049
|
+
The search stops when the final output OP accuracy check shows "Matches".
|
|
2050
|
+
When used together with -cotof, the generated JSON is used to re-evaluate accuracy.
|
|
2051
|
+
WARNING: This option performs an exhaustive search to find the optimal conversion patterns,
|
|
2052
|
+
which can take a very long time depending on the model complexity.
|
|
2053
|
+
|
|
2028
2054
|
-dms, --disable_model_save
|
|
2029
2055
|
Does not save the converted model. For CIs RAM savings.
|
|
2030
2056
|
|
|
@@ -2094,6 +2120,7 @@ convert(
|
|
|
2094
2120
|
replace_to_pseudo_operators: List[str] = None,
|
|
2095
2121
|
mvn_epsilon: Union[float, NoneType] = 0.0000000001,
|
|
2096
2122
|
param_replacement_file: Optional[str] = '',
|
|
2123
|
+
auto_generate_json: Optional[bool] = False,
|
|
2097
2124
|
check_gpu_delegate_compatibility: Optional[bool] = False,
|
|
2098
2125
|
check_onnx_tf_outputs_elementwise_close: Optional[bool] = False,
|
|
2099
2126
|
check_onnx_tf_outputs_elementwise_close_full: Optional[bool] = False,
|
|
@@ -2438,6 +2465,15 @@ convert(
|
|
|
2438
2465
|
param_replacement_file: Optional[str]
|
|
2439
2466
|
Parameter replacement file path. (.json)
|
|
2440
2467
|
|
|
2468
|
+
auto_generate_json: Optional[bool]
|
|
2469
|
+
Automatically generates a parameter replacement JSON file that achieves minimal error
|
|
2470
|
+
when converting the model. This option explores various parameter combinations to find
|
|
2471
|
+
the best settings that result in successful conversion and highest accuracy.
|
|
2472
|
+
The search stops when the final output OP accuracy check shows "Matches".
|
|
2473
|
+
When used together with check_onnx_tf_outputs_elementwise_close_full,
|
|
2474
|
+
the generated JSON is used to re-evaluate accuracy.
|
|
2475
|
+
Default: False
|
|
2476
|
+
|
|
2441
2477
|
check_gpu_delegate_compatibility: Optional[bool]
|
|
2442
2478
|
Run TFLite ModelAnalyzer on the generated Float16 tflite model
|
|
2443
2479
|
to check if the model can be supported by GPU Delegate.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
onnx2tf/__init__.py,sha256=
|
|
1
|
+
onnx2tf/__init__.py,sha256=_bz5n8zEp9SjBSnI_J1s35oR-5bngGBMjVCVYVDdQ54,66
|
|
2
2
|
onnx2tf/__main__.py,sha256=2RSCQ7d4lc6CwD-rlGn9UicPFg-P5du7ZD_yh-kuBEU,57
|
|
3
|
-
onnx2tf/onnx2tf.py,sha256=
|
|
3
|
+
onnx2tf/onnx2tf.py,sha256=ufjdjeokS96PyvhLAV4nOaiPZ69FCP2kbvBVGahzxxQ,146784
|
|
4
4
|
onnx2tf/ops/Abs.py,sha256=V7btmCG_ZvK_qJovUsguq0ZMJ349mhNQ4FHSgzP_Yuo,4029
|
|
5
5
|
onnx2tf/ops/Acos.py,sha256=Fo8YkFKuWq8Fi2xUrBdKcAH1yJ8r5pjSD0wgLttTNdk,4003
|
|
6
6
|
onnx2tf/ops/Acosh.py,sha256=ATQj2cT5JS_mTfXi0kXqJ1yzSZu5J0zHA5VjV3j7uKY,3588
|
|
@@ -185,13 +185,15 @@ onnx2tf/ops/_Loop.py,sha256=eo5sNfrfOnKV6_I737AWsM5LJTY9DVOxQEvhanxtP4g,11322
|
|
|
185
185
|
onnx2tf/ops/__Loop.py,sha256=ClwMcbNS4hqUtW_pzwjMa9Cqg7ONvz9aplke55A0uJ0,19704
|
|
186
186
|
onnx2tf/ops/__init__.py,sha256=jnmUWWa-3dHzBZV9bmPzXu6eoz2dumJTzO7i8JdcgSM,25
|
|
187
187
|
onnx2tf/utils/__init__.py,sha256=E9FM9He68VIASDnYp-OrxvHFVn55GzWqw2OEkCqn1zg,27
|
|
188
|
-
onnx2tf/utils/common_functions.py,sha256=
|
|
188
|
+
onnx2tf/utils/common_functions.py,sha256=QdIh2V8st7R-7H6pyOtTb3oOgNeFZDX7YH21H63_XDA,245602
|
|
189
189
|
onnx2tf/utils/enums.py,sha256=7c5TqetqB07VjyHoxJHfLgtqBqk9ZRyUF33fPOJR1IM,1649
|
|
190
|
+
onnx2tf/utils/iterative_json_optimizer.py,sha256=qqeIxWGxrhcCYk8-ebWnblnOkzDCwi-nseipHzHR_bk,10436
|
|
191
|
+
onnx2tf/utils/json_auto_generator.py,sha256=Vyy21SYEoSL0b-I1cUnaXR-CPoO8LJYQ3fAS2ulZSMM,61964
|
|
190
192
|
onnx2tf/utils/logging.py,sha256=yUCmPuJ_XiUItM3sZMcaMO24JErkQy7zZwVTYWAuiKg,1982
|
|
191
|
-
onnx2tf-1.
|
|
192
|
-
onnx2tf-1.
|
|
193
|
-
onnx2tf-1.
|
|
194
|
-
onnx2tf-1.
|
|
195
|
-
onnx2tf-1.
|
|
196
|
-
onnx2tf-1.
|
|
197
|
-
onnx2tf-1.
|
|
193
|
+
onnx2tf-1.28.0.dist-info/licenses/LICENSE,sha256=5v_Kxihy8i6mzHVl349ikSREaIdsl9YeUnX1KBDLD2w,1070
|
|
194
|
+
onnx2tf-1.28.0.dist-info/licenses/LICENSE_onnx-tensorflow,sha256=gK4GtS9S5YcyINu6uuNNWdo-kBClyEM4MFLFGiNTeRM,11231
|
|
195
|
+
onnx2tf-1.28.0.dist-info/METADATA,sha256=AAAKjgJIdmg6sMeDYnhWeA0aUDTl1-2PB5U-vFPMKas,151177
|
|
196
|
+
onnx2tf-1.28.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
197
|
+
onnx2tf-1.28.0.dist-info/entry_points.txt,sha256=gDPK8ToCFPKMvm8jr9xrGOkXtORJJVh4736fBEKO5k0,41
|
|
198
|
+
onnx2tf-1.28.0.dist-info/top_level.txt,sha256=WgfPiEy3f6vZ_FOpAIEA2CF3TCx1eYrhGw93Ih6b9Fw,8
|
|
199
|
+
onnx2tf-1.28.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|