onnx2tf 1.26.0__py3-none-any.whl → 1.26.1__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 +15 -7
- {onnx2tf-1.26.0.dist-info → onnx2tf-1.26.1.dist-info}/METADATA +12 -12
- {onnx2tf-1.26.0.dist-info → onnx2tf-1.26.1.dist-info}/RECORD +9 -9
- {onnx2tf-1.26.0.dist-info → onnx2tf-1.26.1.dist-info}/LICENSE +0 -0
- {onnx2tf-1.26.0.dist-info → onnx2tf-1.26.1.dist-info}/LICENSE_onnx-tensorflow +0 -0
- {onnx2tf-1.26.0.dist-info → onnx2tf-1.26.1.dist-info}/WHEEL +0 -0
- {onnx2tf-1.26.0.dist-info → onnx2tf-1.26.1.dist-info}/entry_points.txt +0 -0
- {onnx2tf-1.26.0.dist-info → onnx2tf-1.26.1.dist-info}/top_level.txt +0 -0
onnx2tf/__init__.py
CHANGED
onnx2tf/onnx2tf.py
CHANGED
|
@@ -222,9 +222,13 @@ def convert(
|
|
|
222
222
|
["input2","input2.npy",[0.3],[0.07]],\n
|
|
223
223
|
]
|
|
224
224
|
|
|
225
|
-
|
|
226
|
-
Input
|
|
227
|
-
"int8"(default) or "uint8"
|
|
225
|
+
input_quant_dtype: Optional[str]
|
|
226
|
+
Input dtypes when doing Full INT8 Quantization.\n
|
|
227
|
+
"int8"(default) or "uint8" or "float32"
|
|
228
|
+
|
|
229
|
+
output_quant_dtype: Optional[str]
|
|
230
|
+
Output dtypes when doing Full INT8 Quantization.\n
|
|
231
|
+
"int8"(default) or "uint8" or "float32"
|
|
228
232
|
|
|
229
233
|
not_use_onnxsim: Optional[bool]
|
|
230
234
|
No optimization by onnx-simplifier is performed.\n
|
|
@@ -1700,6 +1704,8 @@ def convert(
|
|
|
1700
1704
|
inf_type_input = tf.int8
|
|
1701
1705
|
elif input_quant_dtype == 'uint8':
|
|
1702
1706
|
inf_type_input = tf.uint8
|
|
1707
|
+
elif input_quant_dtype == 'float32':
|
|
1708
|
+
inf_type_input = tf.float32
|
|
1703
1709
|
else:
|
|
1704
1710
|
inf_type_input = tf.int8
|
|
1705
1711
|
|
|
@@ -1707,6 +1713,8 @@ def convert(
|
|
|
1707
1713
|
inf_type_output = tf.int8
|
|
1708
1714
|
elif output_quant_dtype == 'uint8':
|
|
1709
1715
|
inf_type_output = tf.uint8
|
|
1716
|
+
elif output_quant_dtype == 'float32':
|
|
1717
|
+
inf_type_output = tf.float32
|
|
1710
1718
|
else:
|
|
1711
1719
|
inf_type_output = tf.int8
|
|
1712
1720
|
converter.inference_input_type = inf_type_input
|
|
@@ -2140,21 +2148,21 @@ def main():
|
|
|
2140
2148
|
'-iqd',
|
|
2141
2149
|
'--input_quant_dtype',
|
|
2142
2150
|
type=str,
|
|
2143
|
-
choices=['int8', 'uint8'],
|
|
2151
|
+
choices=['int8', 'uint8', 'float32'],
|
|
2144
2152
|
default='int8',
|
|
2145
2153
|
help=\
|
|
2146
2154
|
'Input dtypes when doing Full INT8 Quantization. \n' +
|
|
2147
|
-
'"int8"(default) or "uint8"'
|
|
2155
|
+
'"int8"(default) or "uint8" or "float32"'
|
|
2148
2156
|
)
|
|
2149
2157
|
parser.add_argument(
|
|
2150
2158
|
'-oqd',
|
|
2151
2159
|
'--output_quant_dtype',
|
|
2152
2160
|
type=str,
|
|
2153
|
-
choices=['int8', 'uint8'],
|
|
2161
|
+
choices=['int8', 'uint8', 'float32'],
|
|
2154
2162
|
default='int8',
|
|
2155
2163
|
help=\
|
|
2156
2164
|
'Output dtypes when doing Full INT8 Quantization. \n' +
|
|
2157
|
-
'"int8"(default) or "uint8"'
|
|
2165
|
+
'"int8"(default) or "uint8" or "float32"'
|
|
2158
2166
|
)
|
|
2159
2167
|
parser.add_argument(
|
|
2160
2168
|
'-nuo',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: onnx2tf
|
|
3
|
-
Version: 1.26.
|
|
3
|
+
Version: 1.26.1
|
|
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
|
|
@@ -314,7 +314,7 @@ Video speed is adjusted approximately 50 times slower than actual speed.
|
|
|
314
314
|
docker run --rm -it \
|
|
315
315
|
-v `pwd`:/workdir \
|
|
316
316
|
-w /workdir \
|
|
317
|
-
ghcr.io/pinto0309/onnx2tf:1.26.
|
|
317
|
+
ghcr.io/pinto0309/onnx2tf:1.26.1
|
|
318
318
|
|
|
319
319
|
or
|
|
320
320
|
|
|
@@ -322,7 +322,7 @@ Video speed is adjusted approximately 50 times slower than actual speed.
|
|
|
322
322
|
docker run --rm -it \
|
|
323
323
|
-v `pwd`:/workdir \
|
|
324
324
|
-w /workdir \
|
|
325
|
-
docker.io/pinto0309/onnx2tf:1.26.
|
|
325
|
+
docker.io/pinto0309/onnx2tf:1.26.1
|
|
326
326
|
|
|
327
327
|
or
|
|
328
328
|
|
|
@@ -1529,8 +1529,8 @@ usage: onnx2tf
|
|
|
1529
1529
|
[-oiqt]
|
|
1530
1530
|
[-qt {per-channel,per-tensor}]
|
|
1531
1531
|
[-cind INPUT_NAME NUMPY_FILE_PATH MEAN STD]
|
|
1532
|
-
[-iqd {int8,uint8}]
|
|
1533
|
-
[-oqd {int8,uint8}]
|
|
1532
|
+
[-iqd {int8,uint8,float32}]
|
|
1533
|
+
[-oqd {int8,uint8,float32}]
|
|
1534
1534
|
[-nuo]
|
|
1535
1535
|
[-nuonag]
|
|
1536
1536
|
[-b BATCH_SIZE]
|
|
@@ -1687,13 +1687,13 @@ optional arguments:
|
|
|
1687
1687
|
and {input_op_name}, {numpy_file_path}, {mean}, and {std} must all be entered.
|
|
1688
1688
|
Otherwise, an error will occur during the -oiqt stage.
|
|
1689
1689
|
|
|
1690
|
-
-iqd {int8,uint8}, --input_quant_dtype {int8,uint8}
|
|
1690
|
+
-iqd {int8,uint8,float32}, --input_quant_dtype {int8,uint8,float32}
|
|
1691
1691
|
Input dtypes when doing Full INT8 Quantization.
|
|
1692
|
-
"int8"(default) or "uint8"
|
|
1692
|
+
"int8"(default) or "uint8" or "float32"
|
|
1693
1693
|
|
|
1694
|
-
-oqd {int8,uint8}, --output_quant_dtype {int8,uint8}
|
|
1694
|
+
-oqd {int8,uint8,float32}, --output_quant_dtype {int8,uint8,float32}
|
|
1695
1695
|
Output dtypes when doing Full INT8 Quantization.
|
|
1696
|
-
"int8"(default) or "uint8"
|
|
1696
|
+
"int8"(default) or "uint8" or "float32"
|
|
1697
1697
|
|
|
1698
1698
|
-nuo, --not_use_onnxsim
|
|
1699
1699
|
No optimization by onnx-simplifier is performed.
|
|
@@ -2180,11 +2180,11 @@ convert(
|
|
|
2180
2180
|
|
|
2181
2181
|
input_quant_dtype: Optional[str]
|
|
2182
2182
|
Input dtypes when doing Full INT8 Quantization.
|
|
2183
|
-
"int8"(default) or "uint8"
|
|
2183
|
+
"int8"(default) or "uint8" or "float32"
|
|
2184
2184
|
|
|
2185
2185
|
output_quant_dtype: Optional[str]
|
|
2186
2186
|
Output dtypes when doing Full INT8 Quantization.
|
|
2187
|
-
"int8"(default) or "uint8"
|
|
2187
|
+
"int8"(default) or "uint8" or "float32"
|
|
2188
2188
|
|
|
2189
2189
|
not_use_onnxsim: Optional[bool]
|
|
2190
2190
|
No optimization by onnx-simplifier is performed.
|
|
@@ -2610,7 +2610,7 @@ Do not submit an issue that only contains an amount of information that cannot b
|
|
|
2610
2610
|
|14|Unsqueeze|1. "param_target": "inputs"<br>`pre_process_transpose_perm`: Transpose is applied to the tensor before the Unsqueeze operation with the perm specified as pre-processing.<br>2. "param_target": "outputs"<br>`post_process_transpose_perm`: Transpose is applied to the tensor after the Unsqueeze operation with the perm specified as post-processing.<br>3. "param_target": "op"<br>`new_shape`: Specifies directly the shape after Unsqueeze processing.<br>{<br> "op_name": "/backbone/backbone.1/Unsqueeze_1",<br> "param_target": "op",<br> "new_shape": [1,15,15,1]<br>}|
|
|
2611
2611
|
|15|Reshape|1. "param_target": "inputs"<br>`values`: Value of `shape`<br>`pre_process_transpose_perm`: Transpose is applied to the tensor before the Reshape operation with the perm specified as pre-processing.<br>2. "param_target": "outputs"<br>`post_process_transpose_perm`: Transpose is applied to the tensor after the Reshape operation with the perm specified as post-processing.|
|
|
2612
2612
|
|16|Resize|1. "param_target": "attributes"<br>`coordinate_transformation_mode`: Value of `coordinate_transformation_mode`<br>`extrapolation_value`: Value of `extrapolation_value`<br>`mode`: Value of `mode`<br>2. "param_target": "inputs"<br>`values`: Value of `roi` or `scales` or `sizes`. `scales`=`[scale_h,scale_w]`,`sizes`=`[h,w]`<br>`pre_process_transpose_perm`: Transpose is applied to the tensor before the Resize operation with the perm specified as pre-processing.<br>3. "param_target": "outputs"<br>`post_process_transpose_perm`: Transpose is applied to the tensor after the Resize operation with the perm specified as post-processing.|
|
|
2613
|
-
|17|Slice|`Slice` implements special replacements separately ignore all automatic conversions and generate `tf.strided_slice` directly by specifying all parameters of `tf.strided_slice` directly.<br>https://www.tensorflow.org/api_docs/python/tf/strided_slice<br>See [replace_slice.json](https://github.com/PINTO0309/onnx2tf/blob/main/replace_slice.json) for a sample description.<br><br>1. "param_target": "op"<br>`begin`: Value of `begin`<br>`end`: Value of `end`<br>`strides`: Value of `strides`<br>`begin_mask`: Value of `begin_mask`<br>`end_mask`: Value of `end_mask`<br>`ellipsis_mask`: Value of `ellipsis_mask`<br>`new_axis_mask`: Value of `new_axis_mask`<br>`shrink_axis_mask`: Value of `shrink_axis_mask`<br>{<br> "op_name": "/Slice",<br> "param_target": "op",<br> "begin": [0,0,1,0],<br> "end": [0,0,0,0],<br> "end_mask": 15<br>}|
|
|
2613
|
+
|17|Slice|`Slice` implements special replacements separately ignore all automatic conversions and generate `tf.strided_slice` directly by specifying all parameters of `tf.strided_slice` directly.<br>https://www.tensorflow.org/api_docs/python/tf/strided_slice<br>See [json_samples/replace_slice.json](https://github.com/PINTO0309/onnx2tf/blob/main/json_samples/replace_slice.json) for a sample description.<br><br>1. "param_target": "op"<br>`begin`: Value of `begin`<br>`end`: Value of `end`<br>`strides`: Value of `strides`<br>`begin_mask`: Value of `begin_mask`<br>`end_mask`: Value of `end_mask`<br>`ellipsis_mask`: Value of `ellipsis_mask`<br>`new_axis_mask`: Value of `new_axis_mask`<br>`shrink_axis_mask`: Value of `shrink_axis_mask`<br>{<br> "op_name": "/Slice",<br> "param_target": "op",<br> "begin": [0,0,1,0],<br> "end": [0,0,0,0],<br> "end_mask": 15<br>}|
|
|
2614
2614
|
|18|Softmax|1. "param_target": "attributes"<br>`axis`: Value of `axis`. The transpositions corresponding to the specified axis are extrapolated before and after `Softmax`.<br>2. "param_target": "inputs"<br>`values`: Value of `tensor`|
|
|
2615
2615
|
|19|Split|1. "param_target": "inputs"<br>`values`: Value of `split`<br>2. "param_target": "attributes"<br>`axis`: Value of `axis`.<br>`num_outputs`: Value of `num_outputs`.|
|
|
2616
2616
|
|20|Sub|1. "param_target": "inputs"<br>`values`: Value of `input`<br>`pre_process_transpose_perm`: Transpose is applied to the tensor before the Sub operation with the perm specified as pre-processing.<br>2. "param_target": "outputs"<br>`post_process_transpose_perm`: Transpose is applied to the tensor after the Sub operation with the perm specified as post-processing.|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
onnx2tf/__init__.py,sha256=
|
|
1
|
+
onnx2tf/__init__.py,sha256=VdUE2DxKBM0W8yDa6byr11bxjYw_QKVdSvq071Ap8Rs,66
|
|
2
2
|
onnx2tf/__main__.py,sha256=2RSCQ7d4lc6CwD-rlGn9UicPFg-P5du7ZD_yh-kuBEU,57
|
|
3
|
-
onnx2tf/onnx2tf.py,sha256=
|
|
3
|
+
onnx2tf/onnx2tf.py,sha256=vUMz_U8PQ0MQE6a8BBmOmsiFKAE-TMZPE1H_fnn0UCo,123824
|
|
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
|
|
@@ -188,10 +188,10 @@ onnx2tf/utils/__init__.py,sha256=E9FM9He68VIASDnYp-OrxvHFVn55GzWqw2OEkCqn1zg,27
|
|
|
188
188
|
onnx2tf/utils/common_functions.py,sha256=35vTJfectN2lPwsVGaka_wzpZpCLJeQDmn327oVj4FA,241128
|
|
189
189
|
onnx2tf/utils/enums.py,sha256=7c5TqetqB07VjyHoxJHfLgtqBqk9ZRyUF33fPOJR1IM,1649
|
|
190
190
|
onnx2tf/utils/logging.py,sha256=yUCmPuJ_XiUItM3sZMcaMO24JErkQy7zZwVTYWAuiKg,1982
|
|
191
|
-
onnx2tf-1.26.
|
|
192
|
-
onnx2tf-1.26.
|
|
193
|
-
onnx2tf-1.26.
|
|
194
|
-
onnx2tf-1.26.
|
|
195
|
-
onnx2tf-1.26.
|
|
196
|
-
onnx2tf-1.26.
|
|
197
|
-
onnx2tf-1.26.
|
|
191
|
+
onnx2tf-1.26.1.dist-info/LICENSE,sha256=5v_Kxihy8i6mzHVl349ikSREaIdsl9YeUnX1KBDLD2w,1070
|
|
192
|
+
onnx2tf-1.26.1.dist-info/LICENSE_onnx-tensorflow,sha256=gK4GtS9S5YcyINu6uuNNWdo-kBClyEM4MFLFGiNTeRM,11231
|
|
193
|
+
onnx2tf-1.26.1.dist-info/METADATA,sha256=h7Qt9w1jz2cYvjyl_nmXcrzhsPmbovld2ZBpxEeu_J4,146536
|
|
194
|
+
onnx2tf-1.26.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
195
|
+
onnx2tf-1.26.1.dist-info/entry_points.txt,sha256=gDPK8ToCFPKMvm8jr9xrGOkXtORJJVh4736fBEKO5k0,41
|
|
196
|
+
onnx2tf-1.26.1.dist-info/top_level.txt,sha256=WgfPiEy3f6vZ_FOpAIEA2CF3TCx1eYrhGw93Ih6b9Fw,8
|
|
197
|
+
onnx2tf-1.26.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|