Constrain OpenVINO versions to `>=2024.0.0,<2025.0.0` (#19122)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com>
pull/19376/head^2
Francesco Mattioli 2 weeks ago committed by GitHub
parent 941c1743e6
commit 27f004a179
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      pyproject.toml
  2. 4
      ultralytics/engine/exporter.py
  3. 4
      ultralytics/nn/autobackend.py

@ -97,7 +97,7 @@ export = [
"onnx>=1.12.0", # ONNX export "onnx>=1.12.0", # ONNX export
"coremltools>=7.0; platform_system != 'Windows' and python_version <= '3.11'", # CoreML supported on macOS and Linux "coremltools>=7.0; platform_system != 'Windows' and python_version <= '3.11'", # CoreML supported on macOS and Linux
"scikit-learn>=1.3.2; platform_system != 'Windows' and python_version <= '3.11'", # CoreML k-means quantization "scikit-learn>=1.3.2; platform_system != 'Windows' and python_version <= '3.11'", # CoreML k-means quantization
"openvino>=2024.0.0", # OpenVINO export "openvino>=2024.0.0,<2025.0.0", # OpenVINO export
"tensorflow>=2.0.0", # TF bug https://github.com/ultralytics/ultralytics/issues/5161 "tensorflow>=2.0.0", # TF bug https://github.com/ultralytics/ultralytics/issues/5161
"tensorflowjs>=3.9.0", # TF.js export, automatically installs tensorflow "tensorflowjs>=3.9.0", # TF.js export, automatically installs tensorflow
"tensorstore>=0.1.63; platform_machine == 'aarch64' and python_version >= '3.9'", # for TF Raspberry Pi exports "tensorstore>=0.1.63; platform_machine == 'aarch64' and python_version >= '3.9'", # for TF Raspberry Pi exports

@ -570,7 +570,7 @@ class Exporter:
@try_export @try_export
def export_openvino(self, prefix=colorstr("OpenVINO:")): def export_openvino(self, prefix=colorstr("OpenVINO:")):
"""YOLO OpenVINO export.""" """YOLO OpenVINO export."""
check_requirements("openvino>=2024.5.0") check_requirements("openvino>=2024.0.0,<2025.0.0")
import openvino as ov import openvino as ov
LOGGER.info(f"\n{prefix} starting export with openvino {ov.__version__}...") LOGGER.info(f"\n{prefix} starting export with openvino {ov.__version__}...")
@ -592,7 +592,7 @@ class Exporter:
if self.model.task != "classify": if self.model.task != "classify":
ov_model.set_rt_info("fit_to_window_letterbox", ["model_info", "resize_type"]) ov_model.set_rt_info("fit_to_window_letterbox", ["model_info", "resize_type"])
ov.runtime.save_model(ov_model, file, compress_to_fp16=self.args.half) ov.save_model(ov_model, file, compress_to_fp16=self.args.half)
yaml_save(Path(file).parent / "metadata.yaml", self.metadata) # add metadata.yaml yaml_save(Path(file).parent / "metadata.yaml", self.metadata) # add metadata.yaml
if self.args.int8: if self.args.int8:

@ -244,7 +244,7 @@ class AutoBackend(nn.Module):
# OpenVINO # OpenVINO
elif xml: elif xml:
LOGGER.info(f"Loading {w} for OpenVINO inference...") LOGGER.info(f"Loading {w} for OpenVINO inference...")
check_requirements("openvino>=2024.0.0") check_requirements("openvino>=2024.0.0,<2025.0.0")
import openvino as ov import openvino as ov
core = ov.Core() core = ov.Core()
@ -600,7 +600,7 @@ class AutoBackend(nn.Module):
results[userdata] = request.results results[userdata] = request.results
# Create AsyncInferQueue, set the callback and start asynchronous inference for each input image # Create AsyncInferQueue, set the callback and start asynchronous inference for each input image
async_queue = self.ov.runtime.AsyncInferQueue(self.ov_compiled_model) async_queue = self.ov.AsyncInferQueue(self.ov_compiled_model)
async_queue.set_callback(callback) async_queue.set_callback(callback)
for i in range(n): for i in range(n):
# Start async inference with userdata=i to specify the position in results list # Start async inference with userdata=i to specify the position in results list

Loading…
Cancel
Save