onnx2tf 1.26.1__py3-none-any.whl → 1.26.3__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.26.1'
3
+ __version__ = '1.26.3'
onnx2tf/onnx2tf.py CHANGED
@@ -1626,6 +1626,7 @@ def convert(
1626
1626
  mean,
1627
1627
  std,
1628
1628
  ]
1629
+
1629
1630
  elif custom_input_op_name_np_data_path is not None:
1630
1631
  for param in custom_input_op_name_np_data_path:
1631
1632
  if len(param) != 4:
@@ -1652,11 +1653,14 @@ def convert(
1652
1653
 
1653
1654
  # representative_dataset_gen
1654
1655
  def representative_dataset_gen():
1655
- for idx in range(data_count):
1656
+ batch_size = model.inputs[0].shape[0]
1657
+ if not isinstance(batch_size, int):
1658
+ batch_size = 1
1659
+ for idx in range(0, data_count, batch_size):
1656
1660
  yield_data_dict = {}
1657
1661
  for model_input_name in model_input_name_list:
1658
1662
  calib_data, mean, std = calib_data_dict[model_input_name]
1659
- normalized_calib_data: np.ndarray = (calib_data[idx] - mean) / std
1663
+ normalized_calib_data: np.ndarray = (calib_data[idx:idx+batch_size] - mean) / std
1660
1664
  yield_data_dict[model_input_name] = tf.cast(tf.convert_to_tensor(normalized_calib_data), tf.float32)
1661
1665
  yield yield_data_dict
1662
1666
 
@@ -1708,7 +1712,7 @@ def convert(
1708
1712
  inf_type_input = tf.float32
1709
1713
  else:
1710
1714
  inf_type_input = tf.int8
1711
-
1715
+
1712
1716
  if output_quant_dtype == 'int8':
1713
1717
  inf_type_output = tf.int8
1714
1718
  elif output_quant_dtype == 'uint8':
onnx2tf/ops/MatMul.py CHANGED
@@ -87,7 +87,7 @@ def make_node(
87
87
  input_tensor_2_is_one_d = False
88
88
  if input_tensor_1.shape is not None \
89
89
  and len(input_tensor_1.shape) == 1:
90
- input_tensor_1 = tf.expand_dims(input_tensor_2, axis=0)
90
+ input_tensor_1 = tf.expand_dims(input_tensor_1, axis=0)
91
91
  input_tensor_1_is_one_d = True
92
92
  elif input_tensor_2.shape is not None \
93
93
  and len(input_tensor_2.shape) == 1:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: onnx2tf
3
- Version: 1.26.1
3
+ Version: 1.26.3
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.1
317
+ ghcr.io/pinto0309/onnx2tf:1.26.3
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.1
325
+ docker.io/pinto0309/onnx2tf:1.26.3
326
326
 
327
327
  or
328
328
 
@@ -1463,9 +1463,13 @@ For example, take a model with multiple inputs and multiple outputs as shown in
1463
1463
  When converting to TensorFlow.js, process as follows.
1464
1464
 
1465
1465
  ```bash
1466
- pip install tensorflowjs
1466
+ pip install -U --no-deps \
1467
+ tensorflowjs \
1468
+ tensorflow_decision_forests \
1469
+ ydf \
1470
+ tensorflow_hub
1467
1471
 
1468
- onnx2tf -i mobilenetv2-12.onnx -ois input:1,3,224,224 -osd
1472
+ onnx2tf -i mobilenetv2-12.onnx -ois input:1,3,224,224 -osd -dgc
1469
1473
 
1470
1474
  tensorflowjs_converter \
1471
1475
  --input_format tf_saved_model \
@@ -1,6 +1,6 @@
1
- onnx2tf/__init__.py,sha256=VdUE2DxKBM0W8yDa6byr11bxjYw_QKVdSvq071Ap8Rs,66
1
+ onnx2tf/__init__.py,sha256=GQ8Cd-IK3KY_z7zOeJbzvlNqa1JZnqZNpGK3P7Hq7eg,66
2
2
  onnx2tf/__main__.py,sha256=2RSCQ7d4lc6CwD-rlGn9UicPFg-P5du7ZD_yh-kuBEU,57
3
- onnx2tf/onnx2tf.py,sha256=vUMz_U8PQ0MQE6a8BBmOmsiFKAE-TMZPE1H_fnn0UCo,123824
3
+ onnx2tf/onnx2tf.py,sha256=0QiBJXhX_m2ZuWoGbAsO_N6z3o9uqN0rL8uEkllYhJc,123980
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
@@ -82,7 +82,7 @@ onnx2tf/ops/LessOrEqual.py,sha256=9Lc8qaYUPVC6yZoQluNqcdHnvpUbfWBOI4Ow38RRAJo,45
82
82
  onnx2tf/ops/Log.py,sha256=UZebF3SGq85BnoPgYyN2j-zzFRp67fJnYPNyu33W55o,3582
83
83
  onnx2tf/ops/LogSoftmax.py,sha256=j2nhYY7__8ViLFJVLA5tS98QEvGS1gTIW0QCdnZWUPQ,3923
84
84
  onnx2tf/ops/LpNormalization.py,sha256=Uu15HgxFNXb6gNMgdTJyf0SLPaLbcbkOYqY_4hMBxNA,3153
85
- onnx2tf/ops/MatMul.py,sha256=vCvDYN-BSSTolhK4I02Zsud29Ubaxn5-RS6clGm195I,18804
85
+ onnx2tf/ops/MatMul.py,sha256=oH-VvMn-RTozk3E8zcFE2-T78csDIygtMksVX30o4MY,18804
86
86
  onnx2tf/ops/MatMulInteger.py,sha256=qHqzdJNI9SeJDbW8pR90baYCdGN6FdOez4hi9EzwXoc,6538
87
87
  onnx2tf/ops/Max.py,sha256=w5nMciO_6ApYUobHuwMGuS3xhuza7eSvKDRhvMPgAuo,3256
88
88
  onnx2tf/ops/MaxPool.py,sha256=_JC4eqBTh-qLkZCMG8RZhthRZ8D2d821zaFMWeGMEWc,15775
@@ -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.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,,
191
+ onnx2tf-1.26.3.dist-info/LICENSE,sha256=5v_Kxihy8i6mzHVl349ikSREaIdsl9YeUnX1KBDLD2w,1070
192
+ onnx2tf-1.26.3.dist-info/LICENSE_onnx-tensorflow,sha256=gK4GtS9S5YcyINu6uuNNWdo-kBClyEM4MFLFGiNTeRM,11231
193
+ onnx2tf-1.26.3.dist-info/METADATA,sha256=Z9LRHNes38qX_F5zyDsJumFxJ-BnD1N246dOw7O-yXw,146609
194
+ onnx2tf-1.26.3.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
195
+ onnx2tf-1.26.3.dist-info/entry_points.txt,sha256=gDPK8ToCFPKMvm8jr9xrGOkXtORJJVh4736fBEKO5k0,41
196
+ onnx2tf-1.26.3.dist-info/top_level.txt,sha256=WgfPiEy3f6vZ_FOpAIEA2CF3TCx1eYrhGw93Ih6b9Fw,8
197
+ onnx2tf-1.26.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.1.0)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5