From f2f1afd2690a3e2c74a976c3ec8aec96edcdaf82 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 6 May 2024 12:23:12 +0200 Subject: [PATCH] `ray[tune]` Windows CI fix (#11674) Signed-off-by: Glenn Jocher --- .github/workflows/ci.yaml | 5 ++--- docs/en/integrations/ray-tune.md | 2 +- tests/test_exports.py | 2 ++ ultralytics/utils/tuner.py | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 458c5bfe..bb0037d4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -201,8 +201,7 @@ jobs: run: | slow="" if [[ "${{ github.event_name }}" == "schedule" ]] || [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then - # WARNING bug in ray>=2.10.0 - pip install mlflow pycocotools "ray[tune]<=2.9.3" + pip install pycocotools mlflow "ray[tune]" slow="--slow" fi pytest $slow --cov=ultralytics/ --cov-report xml tests/ @@ -249,7 +248,7 @@ jobs: - name: Install requirements run: | python -m pip install --upgrade pip wheel - pip install -e ".[export]" pytest mlflow pycocotools "ray[tune]<=2.9.3" + pip install -e ".[export]" pytest mlflow pycocotools "ray[tune]" - name: Check environment run: | yolo checks diff --git a/docs/en/integrations/ray-tune.md b/docs/en/integrations/ray-tune.md index c59fe2df..9e4a6363 100644 --- a/docs/en/integrations/ray-tune.md +++ b/docs/en/integrations/ray-tune.md @@ -34,7 +34,7 @@ To install the required packages, run: ```bash # Install and update Ultralytics and Ray Tune packages - pip install -U ultralytics "ray[tune]<=2.9.3" + pip install -U ultralytics "ray[tune]" # Optionally install W&B for logging pip install wandb diff --git a/tests/test_exports.py b/tests/test_exports.py index cb734c3b..fb829c76 100644 --- a/tests/test_exports.py +++ b/tests/test_exports.py @@ -107,6 +107,8 @@ def test_export_torchscript_matrix(task, dynamic, int8, half, batch): @pytest.mark.slow @pytest.mark.skipif(not MACOS, reason="CoreML inference only supported on macOS") +@pytest.mark.skipif(not TORCH_1_9, reason="CoreML>=7.2 not supported with PyTorch<=1.8") +@pytest.mark.skipif(checks.IS_PYTHON_3_12, reason="CoreML not supported in Python 3.12") @pytest.mark.parametrize( "task, dynamic, int8, half, batch", [ # generate all combinations but exclude those where both int8 and half are True diff --git a/ultralytics/utils/tuner.py b/ultralytics/utils/tuner.py index 91d3aa68..1bde002c 100644 --- a/ultralytics/utils/tuner.py +++ b/ultralytics/utils/tuner.py @@ -57,7 +57,7 @@ def run_ray_tune( except (ImportError, AssertionError): wandb = False - checks.check_version(ray.__version__, "<=2.9.3", "ray") + checks.check_version(ray.__version__, ">=2.0.0", "ray") default_space = { # 'optimizer': tune.choice(['SGD', 'Adam', 'AdamW', 'NAdam', 'RAdam', 'RMSProp']), "lr0": tune.uniform(1e-5, 1e-1),