onnx2tf 1.29.19__py3-none-any.whl → 1.29.21__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 +996 -27
- onnx2tf/ops/GatherElements.py +25 -7
- onnx2tf/ops/GatherND.py +28 -1
- onnx2tf/ops/ScatterElements.py +25 -7
- onnx2tf/ops/ScatterND.py +45 -6
- onnx2tf/ops/TensorScatter.py +20 -6
- onnx2tf/utils/common_functions.py +198 -4
- {onnx2tf-1.29.19.dist-info → onnx2tf-1.29.21.dist-info}/METADATA +51 -8
- {onnx2tf-1.29.19.dist-info → onnx2tf-1.29.21.dist-info}/RECORD +12 -12
- {onnx2tf-1.29.19.dist-info → onnx2tf-1.29.21.dist-info}/WHEEL +0 -0
- {onnx2tf-1.29.19.dist-info → onnx2tf-1.29.21.dist-info}/entry_points.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: onnx2tf
|
|
3
|
-
Version: 1.29.
|
|
3
|
+
Version: 1.29.21
|
|
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
|
Keywords: onnx,tensorflow,tflite,keras,deep-learning,machine-learning
|
|
6
6
|
Author: Katsuya Hyodo
|
|
@@ -18,7 +18,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
18
18
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
19
|
Requires-Dist: requests==2.32.5
|
|
20
20
|
Requires-Dist: numpy==1.26.4
|
|
21
|
-
Requires-Dist: onnx==1.19.
|
|
21
|
+
Requires-Dist: onnx==1.19.1
|
|
22
22
|
Requires-Dist: onnxruntime==1.23.0
|
|
23
23
|
Requires-Dist: opencv-python==4.11.0.86
|
|
24
24
|
Requires-Dist: onnxsim==0.4.36
|
|
@@ -365,7 +365,7 @@ Video speed is adjusted approximately 50 times slower than actual speed.
|
|
|
365
365
|
docker run --rm -it \
|
|
366
366
|
-v `pwd`:/workdir \
|
|
367
367
|
-w /workdir \
|
|
368
|
-
ghcr.io/pinto0309/onnx2tf:1.29.
|
|
368
|
+
ghcr.io/pinto0309/onnx2tf:1.29.21
|
|
369
369
|
|
|
370
370
|
or
|
|
371
371
|
|
|
@@ -373,18 +373,18 @@ Video speed is adjusted approximately 50 times slower than actual speed.
|
|
|
373
373
|
docker run --rm -it \
|
|
374
374
|
-v `pwd`:/workdir \
|
|
375
375
|
-w /workdir \
|
|
376
|
-
docker.io/pinto0309/onnx2tf:1.29.
|
|
376
|
+
docker.io/pinto0309/onnx2tf:1.29.21
|
|
377
377
|
|
|
378
378
|
or
|
|
379
379
|
|
|
380
|
-
pip install -U onnx==1.19.
|
|
380
|
+
pip install -U onnx==1.19.1 \
|
|
381
381
|
&& pip install -U onnx-graphsurgeon==0.5.8 \
|
|
382
382
|
&& pip install -U onnxruntime==1.23.0 \
|
|
383
383
|
&& pip install -U onnxsim==0.4.36 \
|
|
384
384
|
&& pip install -U onnxoptimizer==0.4.2 \
|
|
385
385
|
&& pip install -U simple_onnx_processing_tools==1.1.32 \
|
|
386
|
-
&& pip install -U sne4onnx
|
|
387
|
-
&& pip install -U sng4onnx
|
|
386
|
+
&& pip install -U sne4onnx==1.0.15 \
|
|
387
|
+
&& pip install -U sng4onnx==1.0.5 \
|
|
388
388
|
&& pip install -U ai_edge_litert==1.2.0 \
|
|
389
389
|
&& pip install -U tensorflow==2.19.0 \
|
|
390
390
|
&& pip install -U protobuf==3.20.3 \
|
|
@@ -630,7 +630,7 @@ After many upgrades, the need for JSON parameter correction has become much less
|
|
|
630
630
|
|
|
631
631
|
`-ois` an option to overwrite the input OP to a static size if it has undefined dimensions. `-cotof` option checks the accuracy of all OPs one by one. `-cotoa` is the error value of the threshold for determining an accuracy error. If there are undefined dimensions in the input OP, it is better to fix them to the static geometry to improve the accuracy of the accuracy measurement.
|
|
632
632
|
|
|
633
|
-
Also, you can use the `-cind` option to specify custom input for `-cotof`, instead of using the default dummy input. Otherwise, all input values will be set to 1. For more information about the `-cind` option, please refer to [here](#cli-parameter).
|
|
633
|
+
Also, you can use the `-cind` option to specify custom input for `-cotof`, instead of using the default dummy input. Otherwise, all input values will be set to 1. You can override the dummy input values with `--value_hints` (scalar only, `*:default` supported). For more information about the `-cind` option, please refer to [here](#cli-parameter).
|
|
634
634
|
|
|
635
635
|
The `-cotof` option only compares the original ONNX and converted TensorFlow (Keras) models at Float32 precision, not at Float16 or INT8 precision.
|
|
636
636
|
|
|
@@ -644,6 +644,10 @@ onnx2tf -i mobilenetv2-12.onnx -b 1 -cotof -cotoa 1e-1
|
|
|
644
644
|
or
|
|
645
645
|
|
|
646
646
|
onnx2tf -i mobilenetv2-12.onnx -cotof -cotoa 1e-1 -cind "input" "/your/path/x.npy"
|
|
647
|
+
|
|
648
|
+
or
|
|
649
|
+
|
|
650
|
+
onnx2tf -i mobilenetv2-12.onnx -cotof -cotoa 1e-1 --value_hints "input:0.5" "*:1.0"
|
|
647
651
|
```
|
|
648
652
|

|
|
649
653
|
|
|
@@ -1826,6 +1830,14 @@ optional arguments:
|
|
|
1826
1830
|
A value of 1 or more must be specified.
|
|
1827
1831
|
Numerical values other than dynamic dimensions are ignored.
|
|
1828
1832
|
|
|
1833
|
+
-vh VALUE_HINTS [VALUE_HINTS ...], \
|
|
1834
|
+
--value_hints VALUE_HINTS [VALUE_HINTS ...]
|
|
1835
|
+
Value hints for dummy inference input tensors.
|
|
1836
|
+
The format is
|
|
1837
|
+
"input_name_1:value" "input_name_2:value" "*:default_value"
|
|
1838
|
+
"*" applies to all inputs not explicitly specified.
|
|
1839
|
+
Values are scalar only.
|
|
1840
|
+
|
|
1829
1841
|
-nlt, --no_large_tensor
|
|
1830
1842
|
Suppresses constant bloat caused by Tile OP when optimizing models in onnxsim.
|
|
1831
1843
|
See: https://github.com/daquexian/onnx-simplifier/issues/178
|
|
@@ -1887,6 +1899,15 @@ optional arguments:
|
|
|
1887
1899
|
model partitioned into subgraphs.
|
|
1888
1900
|
e.g. --output_names_to_interrupt_model_conversion "output0" "output1" "output2"
|
|
1889
1901
|
|
|
1902
|
+
-easm, --enable_auto_split_model
|
|
1903
|
+
Force auto split regardless of the ONNX file size.
|
|
1904
|
+
Uses --auto_split_max_size_mb as the target partition size.
|
|
1905
|
+
|
|
1906
|
+
-asmsm AUTO_SPLIT_MAX_SIZE_MB, --auto_split_max_size_mb AUTO_SPLIT_MAX_SIZE_MB
|
|
1907
|
+
Target maximum size per partition in MB based on ONNX initializer sizes.
|
|
1908
|
+
Used when auto-split is triggered or forced.
|
|
1909
|
+
Default: 1024
|
|
1910
|
+
|
|
1890
1911
|
-dgc, --disable_group_convolution
|
|
1891
1912
|
Disable GroupConvolution and replace it with SeparableConvolution for
|
|
1892
1913
|
output to saved_model format.
|
|
@@ -2148,6 +2169,7 @@ convert(
|
|
|
2148
2169
|
batch_size: Union[int, NoneType] = None,
|
|
2149
2170
|
overwrite_input_shape: Union[List[str], NoneType] = None,
|
|
2150
2171
|
shape_hints: Union[List[str], NoneType] = None,
|
|
2172
|
+
value_hints: Union[List[str], NoneType] = None,
|
|
2151
2173
|
no_large_tensor: Optional[bool] = False,
|
|
2152
2174
|
output_nms_with_dynamic_tensor: Optional[bool] = False,
|
|
2153
2175
|
switch_nms_version: Optional[str] = 'v4',
|
|
@@ -2156,6 +2178,8 @@ convert(
|
|
|
2156
2178
|
keep_shape_absolutely_input_names: Optional[List[str]] = None,
|
|
2157
2179
|
input_names_to_interrupt_model_conversion: Union[List[str], NoneType] = None,
|
|
2158
2180
|
output_names_to_interrupt_model_conversion: Union[List[str], NoneType] = None,
|
|
2181
|
+
enable_auto_split_model: Optional[bool] = False,
|
|
2182
|
+
auto_split_max_size_mb: Optional[int] = 1024,
|
|
2159
2183
|
disable_group_convolution: Union[bool, NoneType] = False,
|
|
2160
2184
|
enable_batchmatmul_unfold: Optional[bool] = False,
|
|
2161
2185
|
enable_rnn_unroll: Optional[bool] = False,
|
|
@@ -2366,6 +2390,13 @@ convert(
|
|
|
2366
2390
|
A value of 1 or more must be specified.
|
|
2367
2391
|
Numerical values other than dynamic dimensions are ignored.
|
|
2368
2392
|
|
|
2393
|
+
value_hints: Optional[List[str]]
|
|
2394
|
+
Value hints for dummy inference input tensors.
|
|
2395
|
+
The format is
|
|
2396
|
+
['input_name_1:value', 'input_name_2:value', '*:default_value']
|
|
2397
|
+
"*" applies to all inputs not explicitly specified.
|
|
2398
|
+
Values are scalar only.
|
|
2399
|
+
|
|
2369
2400
|
no_large_tensor: Optional[bool]
|
|
2370
2401
|
Suppresses constant bloat caused by Tile OP when optimizing models in onnxsim.
|
|
2371
2402
|
See: https://github.com/daquexian/onnx-simplifier/issues/178
|
|
@@ -2424,6 +2455,17 @@ convert(
|
|
|
2424
2455
|
e.g.
|
|
2425
2456
|
output_names_to_interrupt_model_conversion=['output0','output1','output2']
|
|
2426
2457
|
|
|
2458
|
+
enable_auto_split_model: Optional[bool]
|
|
2459
|
+
Force auto split regardless of the ONNX file size.
|
|
2460
|
+
Uses auto_split_max_size_mb as the target partition size.
|
|
2461
|
+
Short option: -easm
|
|
2462
|
+
Default: False
|
|
2463
|
+
|
|
2464
|
+
auto_split_max_size_mb: Optional[int]
|
|
2465
|
+
Target maximum size per partition in MB based on ONNX initializer sizes.
|
|
2466
|
+
Used when auto-split is triggered or forced.
|
|
2467
|
+
Default: 1024
|
|
2468
|
+
|
|
2427
2469
|
disable_group_convolution: Optional[bool]
|
|
2428
2470
|
Disable GroupConvolution and replace it with SeparableConvolution for
|
|
2429
2471
|
output to saved_model format.
|
|
@@ -3010,6 +3052,7 @@ The above differences often cannot be dealt with by simply converting the model
|
|
|
3010
3052
|
14. [nobuco](https://github.com/AlexanderLutsenko/nobuco)
|
|
3011
3053
|
15. [onnx2torch](https://github.com/ENOT-AutoDL/onnx2torch)
|
|
3012
3054
|
16. [ai-edge-torch](https://github.com/google-ai-edge/ai-edge-torch)
|
|
3055
|
+
17. [LiteRT.js](https://ai.google.dev/edge/litert/web)
|
|
3013
3056
|
|
|
3014
3057
|
## Acknowledgement
|
|
3015
3058
|
1. https://github.com/onnx/models
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
onnx2tf/__init__.py,sha256=
|
|
1
|
+
onnx2tf/__init__.py,sha256=oN6Sb7PL3XQhFQGL8NsC07srojuozSUJPFJDOv1ST2k,67
|
|
2
2
|
onnx2tf/__main__.py,sha256=2RSCQ7d4lc6CwD-rlGn9UicPFg-P5du7ZD_yh-kuBEU,57
|
|
3
|
-
onnx2tf/onnx2tf.py,sha256=
|
|
3
|
+
onnx2tf/onnx2tf.py,sha256=BC-BFMf8QUG7PtOvpwglhe1sc4FhTO8AMrdlxKUN5jc,208204
|
|
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
|
|
@@ -60,8 +60,8 @@ onnx2tf/ops/Floor.py,sha256=8izJrNmw8wNmjF_YabIpLs4jm82J-gKcyAQbwV7Yqpc,3589
|
|
|
60
60
|
onnx2tf/ops/FusedConv.py,sha256=gslI50V3yvt4l0mmodnyHFAu0cORx1J_ZL5cE0rZ8qs,4523
|
|
61
61
|
onnx2tf/ops/GRU.py,sha256=kBHiZlhlPIV2DQCoFYFHxCTwOATeguJy1MSfj2kxqDM,30732
|
|
62
62
|
onnx2tf/ops/Gather.py,sha256=ezsUTN8nWau4-kB696xjonlVWU6XQ6BjtyjSebt1EXg,15216
|
|
63
|
-
onnx2tf/ops/GatherElements.py,sha256=
|
|
64
|
-
onnx2tf/ops/GatherND.py,sha256=
|
|
63
|
+
onnx2tf/ops/GatherElements.py,sha256=qF8milhgXOOc_G3W80U2rK7Q2SsHlPNHrs4VX20ddDY,16002
|
|
64
|
+
onnx2tf/ops/GatherND.py,sha256=2PwSyXHwPP9_xADPasjxj-IXAvLNqKuGm3P5K3GOiwE,9239
|
|
65
65
|
onnx2tf/ops/Gelu.py,sha256=ms9oHnESOuiIPxl_8YU2WEnQo_BVKRPKo5UJsvsWyEA,4321
|
|
66
66
|
onnx2tf/ops/Gemm.py,sha256=8vGtXwx_V59JIDh3EBPuFVQSbIVql45zEHUlVGV3coU,7587
|
|
67
67
|
onnx2tf/ops/GlobalAveragePool.py,sha256=GrDDOywtO6peW79mBPmBJX9MrEU2PXso94xazAzx_xk,5704
|
|
@@ -160,8 +160,8 @@ onnx2tf/ops/STFT.py,sha256=LDKN309_dBu4v9AYpz70uMJbNjRFiOte9O3wUL4bIJw,4463
|
|
|
160
160
|
onnx2tf/ops/ScaleAndTranslate.py,sha256=VQDDhSs9TyMLQy0mF7n8pZ2TuvoKY-Lhlzd7Inf4UdI,11989
|
|
161
161
|
onnx2tf/ops/Scan.py,sha256=hfN-DX6Gp-dG5158WMoHRrDWZAra3VSbsjsiphNqRIQ,16293
|
|
162
162
|
onnx2tf/ops/Scatter.py,sha256=5_rTM60FPCq8unyNPDO-BZXcuz6w9Uyl2Xqx-zJTpgg,746
|
|
163
|
-
onnx2tf/ops/ScatterElements.py,sha256=
|
|
164
|
-
onnx2tf/ops/ScatterND.py,sha256
|
|
163
|
+
onnx2tf/ops/ScatterElements.py,sha256=mp-TmswDTA9Nv0B3G3b-khOCPCKHnhCI97jDRofoEM0,8561
|
|
164
|
+
onnx2tf/ops/ScatterND.py,sha256=-mVbxXjQor2T6HVHSJy5e0FHQmEfaHknaKPuSc3Oz4o,11005
|
|
165
165
|
onnx2tf/ops/Selu.py,sha256=CD0SqQlTTe0chO7lebkrdfDFSk6Cg9zLhvrKomsSH4Y,3799
|
|
166
166
|
onnx2tf/ops/SequenceAt.py,sha256=jpjl9gVJFagtg223YY26I0pUUEgEFjJGvSZWwbo2-mQ,3278
|
|
167
167
|
onnx2tf/ops/SequenceConstruct.py,sha256=KKbnpnitdAky23WF_DS49ot7ZxVoqBEU2ChgYEcXshY,2639
|
|
@@ -193,7 +193,7 @@ onnx2tf/ops/Sub.py,sha256=JCUWNmRLrwJEB8_0MPRTzmZ4KAV_HLXNivUd_jNqPQI,11012
|
|
|
193
193
|
onnx2tf/ops/Sum.py,sha256=wtI0SbGuNFxkLskBk68ZhOAg3XyrIx-9xGYy1GZCVSo,3073
|
|
194
194
|
onnx2tf/ops/Tan.py,sha256=Ncig8clGvY7GWshqxRDRdcxjcbf_HTKGdpDw5ValrKI,3582
|
|
195
195
|
onnx2tf/ops/Tanh.py,sha256=PIQUvxS_AIDufblC2vc573nse2UCRA9z5yWd7kB-51s,3585
|
|
196
|
-
onnx2tf/ops/TensorScatter.py,sha256=
|
|
196
|
+
onnx2tf/ops/TensorScatter.py,sha256=9M1L8ys2FodscRZXdjme5NQYrCFX_nZH7wm8vx-PXcc,8176
|
|
197
197
|
onnx2tf/ops/ThresholdedRelu.py,sha256=ArF3uRH7jN8kdYYDNcivJgv9UTFl5aqqSH2Qu79j4sY,3769
|
|
198
198
|
onnx2tf/ops/Tile.py,sha256=xkprg6yTaykivcHFJ644opzVPctaeplu-Ed-OpS98Gg,12720
|
|
199
199
|
onnx2tf/ops/TopK.py,sha256=f6OG-DcMWneXwSjIkmY935SPyOMD5tMteHnlQHoJwQo,6348
|
|
@@ -206,12 +206,12 @@ onnx2tf/ops/Where.py,sha256=MaCcY9g4mKZQqCgh4xtoylicP-xVu9f4boKiu_q9Ow8,7711
|
|
|
206
206
|
onnx2tf/ops/Xor.py,sha256=2ceqxHSI1Wtez_CIh8gFfvcu45Xboqfyp1iy3v2vuIs,4590
|
|
207
207
|
onnx2tf/ops/__init__.py,sha256=jnmUWWa-3dHzBZV9bmPzXu6eoz2dumJTzO7i8JdcgSM,25
|
|
208
208
|
onnx2tf/utils/__init__.py,sha256=E9FM9He68VIASDnYp-OrxvHFVn55GzWqw2OEkCqn1zg,27
|
|
209
|
-
onnx2tf/utils/common_functions.py,sha256=
|
|
209
|
+
onnx2tf/utils/common_functions.py,sha256=ioOk2F5KnCepNW3FBt_4sAnsq_Jld0w0p8fbhWfuR2w,268342
|
|
210
210
|
onnx2tf/utils/enums.py,sha256=7c5TqetqB07VjyHoxJHfLgtqBqk9ZRyUF33fPOJR1IM,1649
|
|
211
211
|
onnx2tf/utils/iterative_json_optimizer.py,sha256=qqeIxWGxrhcCYk8-ebWnblnOkzDCwi-nseipHzHR_bk,10436
|
|
212
212
|
onnx2tf/utils/json_auto_generator.py,sha256=OC-SfKtUg7zUxaXTAg6kT0ShzIc3ByjDa3FNp173DtA,60302
|
|
213
213
|
onnx2tf/utils/logging.py,sha256=yUCmPuJ_XiUItM3sZMcaMO24JErkQy7zZwVTYWAuiKg,1982
|
|
214
|
-
onnx2tf-1.29.
|
|
215
|
-
onnx2tf-1.29.
|
|
216
|
-
onnx2tf-1.29.
|
|
217
|
-
onnx2tf-1.29.
|
|
214
|
+
onnx2tf-1.29.21.dist-info/WHEEL,sha256=fAguSjoiATBe7TNBkJwOjyL1Tt4wwiaQGtNtjRPNMQA,80
|
|
215
|
+
onnx2tf-1.29.21.dist-info/entry_points.txt,sha256=GuhvLu7ZlYECumbmoiFlKX0mFPtFi_Ti9L-E5yuQqKs,42
|
|
216
|
+
onnx2tf-1.29.21.dist-info/METADATA,sha256=LKRmQIHHTw23h1BZd-KhyHQz46BWSK9ib2WaUvgyld8,156067
|
|
217
|
+
onnx2tf-1.29.21.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|