diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index 6c958443..b0ea6b89 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license -__version__ = "8.3.134" +__version__ = "8.3.135" import os diff --git a/ultralytics/engine/exporter.py b/ultralytics/engine/exporter.py index 0f601117..3d37905f 100644 --- a/ultralytics/engine/exporter.py +++ b/ultralytics/engine/exporter.py @@ -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,