ultralytics 8.3.135 TF.js fix with onnx>=1.12.0,<1.18.0 pin (#20640)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: Mohammed Yasin <32206511+Y-T-G@users.noreply.github.com>
Co-authored-by: Laughing-q <1185102784@qq.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Muhammad Rizwan Munawar 2025-05-15 17:55:40 +05:00 committed by GitHub
parent 61ed1d77d8
commit 37ebf6e89b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
__version__ = "8.3.134"
__version__ = "8.3.135"
import os

View File

@ -926,7 +926,7 @@ class Exporter:
"sng4onnx>=1.0.1", # required by 'onnx2tf' package
"onnx_graphsurgeon>=0.3.26", # required by 'onnx2tf' package
"ai-edge-litert>=1.2.0", # required by 'onnx2tf' package
"onnx>=1.12.0",
"onnx>=1.12.0,<1.18.0",
"onnx2tf>=1.26.3",
"onnxslim>=0.1.46",
"onnxruntime-gpu" if cuda else "onnxruntime",
@ -943,8 +943,6 @@ class Exporter:
verbose=True,
msg="https://github.com/ultralytics/ultralytics/issues/5161",
)
import onnx2tf
f = Path(str(self.file).replace(self.file.suffix, "_saved_model"))
if f.is_dir():
shutil.rmtree(f) # delete output folder
@ -971,6 +969,8 @@ class Exporter:
np.save(str(tmp_file), images.numpy().astype(np.float32)) # BHWC
np_data = [["images", tmp_file, [[[[0, 0, 0]]]], [[[[255, 255, 255]]]]]]
import onnx2tf # scoped for after ONNX export for reduced conflict during import
LOGGER.info(f"{prefix} starting TFLite export with onnx2tf {onnx2tf.__version__}...")
keras_model = onnx2tf.convert(
input_onnx_file_path=f_onnx,