onnx2tf 1.27.2__py3-none-any.whl → 1.27.4__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 CHANGED
@@ -1,3 +1,3 @@
1
1
  from onnx2tf.onnx2tf import convert, main
2
2
 
3
- __version__ = '1.27.2'
3
+ __version__ = '1.27.4'
onnx2tf/onnx2tf.py CHANGED
@@ -1259,11 +1259,6 @@ def convert(
1259
1259
  if len(msg_list) > 0:
1260
1260
  for s in msg_list:
1261
1261
  if 'Unable to serialize VariableSpec' in s:
1262
- warn(
1263
- f'This model contains GroupConvolution and is automatically optimized for TFLite, ' +
1264
- f'but is not output because h5 does not support GroupConvolution. ' +
1265
- f'If h5 is needed, specify --disable_group_convolution to retransform the model.'
1266
- )
1267
1262
  break
1268
1263
  else:
1269
1264
  error(e)
@@ -1285,11 +1280,6 @@ def convert(
1285
1280
  if len(msg_list) > 0:
1286
1281
  for s in msg_list:
1287
1282
  if 'Unable to serialize VariableSpec' in s:
1288
- warn(
1289
- f'This model contains GroupConvolution and is automatically optimized for TFLite, ' +
1290
- f'but is not output because keras_v3 does not support GroupConvolution. ' +
1291
- f'If keras_v3 is needed, specify --disable_group_convolution to retransform the model.'
1292
- )
1293
1283
  break
1294
1284
  else:
1295
1285
  error(e)
@@ -1404,10 +1394,7 @@ def convert(
1404
1394
  )
1405
1395
  info(Color.GREEN(f'TFv1 .pb output complete!'))
1406
1396
  except KeyError as e:
1407
- warn(
1408
- f'Probably due to GroupConvolution, saved_model could not be generated successfully, ' +
1409
- f'so onnx2tf skip the output of TensorFlow v1 pb.'
1410
- )
1397
+ pass
1411
1398
  except Exception as e:
1412
1399
  error(e)
1413
1400
  import traceback
onnx2tf/ops/Conv.py CHANGED
@@ -468,12 +468,6 @@ def make_node(
468
468
  error_check_tf_op_type = 'conv_bias'
469
469
 
470
470
  else:
471
- if kernel_size in (1, 2, 3) and not disable_group_convolution:
472
- warn(
473
- f'This model contains GroupConvolution and is automatically optimized for TFLite, ' +
474
- f'but is not output because saved_model does not support GroupConvolution. ' +
475
- f'If saved_model is needed, specify --disable_group_convolution to retransform the model.'
476
- )
477
471
  # GroupedConvolution - Conv1D, Conv2D, Conv3D - Bias Add
478
472
  if kernel_size == 1 and not disable_group_convolution:
479
473
  tf_layers_dict[graph_node_output.name]['tf_node'] = \
@@ -571,12 +565,6 @@ def make_node(
571
565
  error_check_tf_op_type = 'conv_nobias'
572
566
 
573
567
  else:
574
- if kernel_size in (1, 2, 3) and not disable_group_convolution:
575
- warn(
576
- f'This model contains GroupConvolution and is automatically optimized for TFLite, ' +
577
- f'but is not output because saved_model does not support GroupConvolution. ' +
578
- f'If saved_model is needed, specify --disable_group_convolution to retransform the model.'
579
- )
580
568
  # GroupedConvolution - Conv1D, Conv2D, Conv3D - No Bias
581
569
  if kernel_size == 1 and not disable_group_convolution:
582
570
  tf_layers_dict[graph_node_output.name]['tf_node'] = \
@@ -417,12 +417,6 @@ def make_node(
417
417
  error_check_tf_op_type = 'conv_nobias'
418
418
 
419
419
  else:
420
- if kernel_size in (1, 2, 3) and not disable_group_convolution:
421
- warn(
422
- f'This model contains GroupConvolution and is automatically optimized for TFLite, ' +
423
- f'but is not output because saved_model does not support GroupConvolution. ' +
424
- f'If saved_model is needed, specify --disable_group_convolution to retransform the model.'
425
- )
426
420
  # GroupedConvolution - Conv1D, Conv2D, Conv3D - No Bias
427
421
  if kernel_size == 1 and not disable_group_convolution:
428
422
  tf_layers_dict[graph_node_output.name]['tf_node'] = \
onnx2tf/ops/Reshape.py CHANGED
@@ -136,14 +136,18 @@ def make_node(
136
136
  else:
137
137
  transposed_tensor = input_tensor
138
138
  except:
139
- transposed_tensor = \
140
- transpose_with_flexing_deterrence(
141
- input_tensor=input_tensor,
142
- perm=list(perm) if perm is not None else None,
143
- output_shape=transposed_tensor_output_shape if None not in transposed_tensor_output_shape else None,
144
- name=graph_node.name,
145
- **kwargs,
146
- )
139
+ try:
140
+ transposed_tensor = \
141
+ transpose_with_flexing_deterrence(
142
+ input_tensor=input_tensor,
143
+ perm=list(perm) if perm is not None else None,
144
+ output_shape=transposed_tensor_output_shape if None not in transposed_tensor_output_shape else None,
145
+ name=graph_node.name,
146
+ **kwargs,
147
+ )
148
+ except:
149
+ transposed_tensor = input_tensor
150
+
147
151
  test_data = None
148
152
  if not isinstance(input_tensor, np.ndarray):
149
153
  if not isinstance(graph_node_input_1, np.ndarray) \
onnx2tf/ops/Resize.py CHANGED
@@ -294,14 +294,25 @@ def make_node(
294
294
  else:
295
295
  h_w_scale = scales[1:input_tensor_rank-1]
296
296
  h_w_shape = input_tensor_shape[1:input_tensor_rank-1]
297
- new_size = tf.cast(
298
- h_w_scale * tf.cast(
299
- h_w_shape,
300
- NUMPY_DTYPES_TO_TF_DTYPES[scales.dtype] \
301
- if isinstance(scales.dtype, np.dtype) else scales.dtype,
302
- ),
303
- tf.int32,
304
- )
297
+ if None not in h_w_shape:
298
+ new_size = tf.cast(
299
+ h_w_scale * tf.cast(
300
+ h_w_shape,
301
+ NUMPY_DTYPES_TO_TF_DTYPES[scales.dtype] \
302
+ if isinstance(scales.dtype, np.dtype) else scales.dtype,
303
+ ),
304
+ tf.int32,
305
+ )
306
+ else:
307
+ h_w_shape = tf.shape(input_tensor)[1:input_tensor_rank-1]
308
+ new_size = tf.cast(
309
+ h_w_scale * tf.cast(
310
+ h_w_shape,
311
+ NUMPY_DTYPES_TO_TF_DTYPES[scales.dtype] \
312
+ if isinstance(scales.dtype, np.dtype) else scales.dtype,
313
+ ),
314
+ tf.int32,
315
+ )
305
316
 
306
317
  if hasattr(new_size, '_inferred_value'):
307
318
  new_size_values = new_size._inferred_value
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: onnx2tf
3
- Version: 1.27.2
3
+ Version: 1.27.4
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
@@ -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.27.2
337
+ ghcr.io/pinto0309/onnx2tf:1.27.4
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.27.2
345
+ docker.io/pinto0309/onnx2tf:1.27.4
346
346
 
347
347
  or
348
348
 
@@ -1,6 +1,6 @@
1
- onnx2tf/__init__.py,sha256=hu7TZkPbwUCwf8zZcrp1NGR2aMUiIbLW_oqR1se7KzI,66
1
+ onnx2tf/__init__.py,sha256=gmbApNBlikoE1jGydbqconZ-bEgpuCTCs_Nku2GCJfQ,66
2
2
  onnx2tf/__main__.py,sha256=2RSCQ7d4lc6CwD-rlGn9UicPFg-P5du7ZD_yh-kuBEU,57
3
- onnx2tf/onnx2tf.py,sha256=IEnfIs3Dy8Y5F3iJ4HY7bWkn3QuB6lq_gHa1q5E3tMI,124745
3
+ onnx2tf/onnx2tf.py,sha256=9g8enwecc2e0vZ3dnvE7ukZYEqsCBOo940zdauvN_-M,123738
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
@@ -26,8 +26,8 @@ onnx2tf/ops/Concat.py,sha256=CKfJbiAwP7h9sFFVyueHJCbwMkUo3NXqkTuRc8v7Tw8,31215
26
26
  onnx2tf/ops/ConcatFromSequence.py,sha256=z8pNmGQRGq9cxWORW330NZS_0zsmhFudLswMyPn8AXU,3086
27
27
  onnx2tf/ops/Constant.py,sha256=BNZLzNI4rK9kXgVWwD-2RFsDsH7mMy7AY2JSgTNXIWk,10696
28
28
  onnx2tf/ops/ConstantOfShape.py,sha256=6eYm-niow-6fHVEyNyi81BdrVe3IbcdazCp2nySWExA,2331
29
- onnx2tf/ops/Conv.py,sha256=2BPHrEFWSWONDFp4Mrs8V426ybKANxUmjFscM8PXXD4,38791
30
- onnx2tf/ops/ConvInteger.py,sha256=Njw7nJhfZcbo4ofC3UMry5EWxs2lRq1X370vSHIZpXw,27095
29
+ onnx2tf/ops/Conv.py,sha256=jcBIgZY4IXxVnlNNmkGhIVbsE6UWmA7xfwe9Jw3J1G8,37881
30
+ onnx2tf/ops/ConvInteger.py,sha256=UVHy1de6uCLM7IXP4vpzPz2pN2ej278lGBiqTPNdXFA,26664
31
31
  onnx2tf/ops/ConvTranspose.py,sha256=C7CR6m3kz0MtUBdtWrrKWZbZL7tJpGXl7Nkn3DRiEaA,15410
32
32
  onnx2tf/ops/Cos.py,sha256=0v5ZJZRzrswVEObyxf4f0RvnWMWZA4uCEdoeq_VE31s,3608
33
33
  onnx2tf/ops/Cosh.py,sha256=-L3QkQtiVBJIv1sSxbXtetVIwgI_2T4WC1O4t2aJ8Gc,3585
@@ -133,8 +133,8 @@ onnx2tf/ops/ReduceProd.py,sha256=I4qqmdfr4t8i1sinuDqZrvndpw6KrpN1B7sFcjRUI9g,124
133
133
  onnx2tf/ops/ReduceSum.py,sha256=8vdqR5Qv8ui783ywa0xVuiMm3MNwRzGOD_GYFpsgPmc,12393
134
134
  onnx2tf/ops/ReduceSumSquare.py,sha256=X8OFxb5YRl6VU12i35f7Gwzegvf4mXO56dp69n2TZPs,12336
135
135
  onnx2tf/ops/Relu.py,sha256=FoCRlHmG-xI3YCPbR_7UlRDbk0Juw6N722iULONkwW0,5627
136
- onnx2tf/ops/Reshape.py,sha256=4nYvi1BK_8rHHPaFGbKJidc8eAjaN7NEG28T87VDYnQ,25507
137
- onnx2tf/ops/Resize.py,sha256=QyU4bM9BVCYng-LeBHMm0gqYrcg5epKOPRpzWVvrtNQ,19557
136
+ onnx2tf/ops/Reshape.py,sha256=_oPKYi1uSwt_aVsuAt9v127lt0aR5jnhHTzxKNEKdx0,25626
137
+ onnx2tf/ops/Resize.py,sha256=nvcp8X7daMapWgmpCsjg4ajt8EdTQCzB6xbHCqmEQ9M,20053
138
138
  onnx2tf/ops/ReverseSequence.py,sha256=W2w_fBCiUXsD28grIz4AHNIoMjYXx6b6HkgwJTVRxf8,3308
139
139
  onnx2tf/ops/RoiAlign.py,sha256=XgLdaJgsI6KX0u8tnQlVsvbpZECZp_TSnEuGR7LTaeM,8360
140
140
  onnx2tf/ops/Round.py,sha256=OHdh1G2qgZe5OWlRc-OEOM4eYaA63LAoQ6hPmmUmR6o,3588
@@ -188,10 +188,10 @@ onnx2tf/utils/__init__.py,sha256=E9FM9He68VIASDnYp-OrxvHFVn55GzWqw2OEkCqn1zg,27
188
188
  onnx2tf/utils/common_functions.py,sha256=HTDca3DGXB3xvc1S50RNscgB57TCiq4yC5Nrafs6ka4,241430
189
189
  onnx2tf/utils/enums.py,sha256=7c5TqetqB07VjyHoxJHfLgtqBqk9ZRyUF33fPOJR1IM,1649
190
190
  onnx2tf/utils/logging.py,sha256=yUCmPuJ_XiUItM3sZMcaMO24JErkQy7zZwVTYWAuiKg,1982
191
- onnx2tf-1.27.2.dist-info/licenses/LICENSE,sha256=5v_Kxihy8i6mzHVl349ikSREaIdsl9YeUnX1KBDLD2w,1070
192
- onnx2tf-1.27.2.dist-info/licenses/LICENSE_onnx-tensorflow,sha256=gK4GtS9S5YcyINu6uuNNWdo-kBClyEM4MFLFGiNTeRM,11231
193
- onnx2tf-1.27.2.dist-info/METADATA,sha256=Vhy11gd-Dvr86ENsHvxyHUhVQGHzwEY6PHvY8KYmVqM,147712
194
- onnx2tf-1.27.2.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
195
- onnx2tf-1.27.2.dist-info/entry_points.txt,sha256=gDPK8ToCFPKMvm8jr9xrGOkXtORJJVh4736fBEKO5k0,41
196
- onnx2tf-1.27.2.dist-info/top_level.txt,sha256=WgfPiEy3f6vZ_FOpAIEA2CF3TCx1eYrhGw93Ih6b9Fw,8
197
- onnx2tf-1.27.2.dist-info/RECORD,,
191
+ onnx2tf-1.27.4.dist-info/licenses/LICENSE,sha256=5v_Kxihy8i6mzHVl349ikSREaIdsl9YeUnX1KBDLD2w,1070
192
+ onnx2tf-1.27.4.dist-info/licenses/LICENSE_onnx-tensorflow,sha256=gK4GtS9S5YcyINu6uuNNWdo-kBClyEM4MFLFGiNTeRM,11231
193
+ onnx2tf-1.27.4.dist-info/METADATA,sha256=PE5yD9J4QEnguJyUXPYBxr77XVSuRSRcElbqO8Rya4E,147712
194
+ onnx2tf-1.27.4.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
195
+ onnx2tf-1.27.4.dist-info/entry_points.txt,sha256=gDPK8ToCFPKMvm8jr9xrGOkXtORJJVh4736fBEKO5k0,41
196
+ onnx2tf-1.27.4.dist-info/top_level.txt,sha256=WgfPiEy3f6vZ_FOpAIEA2CF3TCx1eYrhGw93Ih6b9Fw,8
197
+ onnx2tf-1.27.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (80.4.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5