Limit `ray<2.9.3` due to bug in `ray==2.10.0` (#9254)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
pull/9253/head^2
Glenn Jocher 1 year ago committed by GitHub
parent 8bb2cdaf6c
commit 7d2e94bbe2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      .github/workflows/ci.yaml
  2. 2
      docs/en/integrations/ray-tune.md
  3. 7
      ultralytics/utils/tuner.py

@ -187,7 +187,8 @@ jobs:
run: |
slow=""
if [[ "${{ github.event_name }}" == "schedule" ]] || [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
pip install mlflow pycocotools 'ray[tune]'
# WARNING bug in ray>=2.10.0
pip install mlflow pycocotools "ray[tune]<=2.9.3"
slow="--slow"
fi
pytest $slow --cov=ultralytics/ --cov-report xml tests/

@ -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]"
pip install -U ultralytics "ray[tune]<=2.9.3"
# Optionally install W&B for logging
pip install wandb

@ -3,7 +3,7 @@
import subprocess
from ultralytics.cfg import TASK2DATA, TASK2METRIC, get_save_dir
from ultralytics.utils import DEFAULT_CFG, DEFAULT_CFG_DICT, LOGGER, NUM_THREADS
from ultralytics.utils import DEFAULT_CFG, DEFAULT_CFG_DICT, LOGGER, NUM_THREADS, checks
def run_ray_tune(
@ -40,7 +40,7 @@ def run_ray_tune(
train_args = {}
try:
subprocess.run("pip install ray[tune]".split(), check=True)
subprocess.run("pip install ray[tune]<=2.9.3".split(), check=True) # do not add single quotes here
import ray
from ray import tune
@ -48,7 +48,7 @@ def run_ray_tune(
from ray.air.integrations.wandb import WandbLoggerCallback
from ray.tune.schedulers import ASHAScheduler
except ImportError:
raise ModuleNotFoundError('Tuning hyperparameters requires Ray Tune. Install with: pip install "ray[tune]"')
raise ModuleNotFoundError('Ray Tune required but not found. To install run: pip install "ray[tune]<=2.9.3"')
try:
import wandb
@ -57,6 +57,7 @@ def run_ray_tune(
except (ImportError, AssertionError):
wandb = False
checks.check_version(ray.__version__, "<=2.9.3", "ray")
default_space = {
# 'optimizer': tune.choice(['SGD', 'Adam', 'AdamW', 'NAdam', 'RAdam', 'RMSProp']),
"lr0": tune.uniform(1e-5, 1e-1),

Loading…
Cancel
Save