diff --git a/pyproject.toml b/pyproject.toml index eaf5956a..1b02f71f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,7 +91,7 @@ export = [ "numpy<2.0.0", # TF 2.20 compatibility "onnx>=1.12.0; platform_system != 'Darwin'", # ONNX export "onnx>=1.12.0,<1.18.0; platform_system == 'Darwin'", # TF inference hanging on MacOS - "coremltools>=8.0; platform_system != 'Windows' and python_version <= '3.13'", # CoreML supported on macOS and Linux + "coremltools>=9.0; platform_system != 'Windows' and python_version <= '3.13'", # CoreML supported on macOS and Linux "scikit-learn>=1.3.2; platform_system != 'Windows' and python_version <= '3.13'", # CoreML k-means quantization "openvino>=2024.0.0", # OpenVINO export "tensorflow>=2.0.0,<=2.19.0", # TF bug https://github.com/ultralytics/ultralytics/issues/5161 diff --git a/ultralytics/engine/exporter.py b/ultralytics/engine/exporter.py index 9d8aa26b..c6c07aca 100644 --- a/ultralytics/engine/exporter.py +++ b/ultralytics/engine/exporter.py @@ -860,7 +860,9 @@ class Exporter: def export_coreml(self, prefix=colorstr("CoreML:")): """Export YOLO model to CoreML format.""" mlmodel = self.args.format.lower() == "mlmodel" # legacy *.mlmodel export format requested - check_requirements("coremltools>=8.0") + check_requirements( + ["coremltools>=9.0", "numpy>=1.14.5,<=2.3.5"] + ) # latest numpy 2.4.0rc1 breaks coremltools exports import coremltools as ct LOGGER.info(f"\n{prefix} starting export with coremltools {ct.__version__}...") @@ -1088,7 +1090,7 @@ class Exporter: # TorchAO release compatibility table bug https://github.com/pytorch/ao/issues/2919 # Setuptools bug: https://github.com/pypa/setuptools/issues/4483 check_requirements("setuptools<71.0.0") # Setuptools bug: https://github.com/pypa/setuptools/issues/4483 - check_requirements(("executorch==1.0.0", "flatbuffers")) + check_requirements(("executorch==1.0.1", "flatbuffers")) import torch from executorch.backends.xnnpack.partition.xnnpack_partitioner import XnnpackPartitioner diff --git a/ultralytics/nn/autobackend.py b/ultralytics/nn/autobackend.py index 08679155..203f3a2a 100644 --- a/ultralytics/nn/autobackend.py +++ b/ultralytics/nn/autobackend.py @@ -400,7 +400,9 @@ class AutoBackend(nn.Module): # CoreML elif coreml: - check_requirements("coremltools>=8.0") + check_requirements( + ["coremltools>=9.0", "numpy>=1.14.5,<=2.3.5"] + ) # latest numpy 2.4.0rc1 breaks coremltools exports LOGGER.info(f"Loading {w} for CoreML inference...") import coremltools as ct @@ -573,7 +575,7 @@ class AutoBackend(nn.Module): LOGGER.info(f"Loading {w} for ExecuTorch inference...") # TorchAO release compatibility table bug https://github.com/pytorch/ao/issues/2919 check_requirements("setuptools<71.0.0") # Setuptools bug: https://github.com/pypa/setuptools/issues/4483 - check_requirements(("executorch==1.0.0", "flatbuffers")) + check_requirements(("executorch==1.0.1", "flatbuffers")) from executorch.runtime import Runtime w = Path(w) diff --git a/ultralytics/utils/checks.py b/ultralytics/utils/checks.py index 7bff9aa5..7eef64fe 100644 --- a/ultralytics/utils/checks.py +++ b/ultralytics/utils/checks.py @@ -410,7 +410,7 @@ def check_requirements(requirements=ROOT.parent / "requirements.txt", exclude=() if use_uv: base = ( f"uv pip install --no-cache-dir {packages} {commands} " - f"--index-strategy=unsafe-best-match --break-system-packages --prerelease=allow" + f"--index-strategy=unsafe-best-match --break-system-packages" ) try: return subprocess.check_output(base, shell=True, stderr=subprocess.STDOUT, text=True)