mirror of
https://github.com/THU-MIG/yolov10.git
synced 2025-05-23 21:44:22 +08:00
Limit ray<2.9.3
due to bug in ray==2.10.0
(#9254)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
8bb2cdaf6c
commit
7d2e94bbe2
3
.github/workflows/ci.yaml
vendored
3
.github/workflows/ci.yaml
vendored
@ -187,7 +187,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
slow=""
|
slow=""
|
||||||
if [[ "${{ github.event_name }}" == "schedule" ]] || [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
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"
|
slow="--slow"
|
||||||
fi
|
fi
|
||||||
pytest $slow --cov=ultralytics/ --cov-report xml tests/
|
pytest $slow --cov=ultralytics/ --cov-report xml tests/
|
||||||
|
@ -34,7 +34,7 @@ To install the required packages, run:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Install and update Ultralytics and Ray Tune packages
|
# 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
|
# Optionally install W&B for logging
|
||||||
pip install wandb
|
pip install wandb
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from ultralytics.cfg import TASK2DATA, TASK2METRIC, get_save_dir
|
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(
|
def run_ray_tune(
|
||||||
@ -40,7 +40,7 @@ def run_ray_tune(
|
|||||||
train_args = {}
|
train_args = {}
|
||||||
|
|
||||||
try:
|
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
|
import ray
|
||||||
from ray import tune
|
from ray import tune
|
||||||
@ -48,7 +48,7 @@ def run_ray_tune(
|
|||||||
from ray.air.integrations.wandb import WandbLoggerCallback
|
from ray.air.integrations.wandb import WandbLoggerCallback
|
||||||
from ray.tune.schedulers import ASHAScheduler
|
from ray.tune.schedulers import ASHAScheduler
|
||||||
except ImportError:
|
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:
|
try:
|
||||||
import wandb
|
import wandb
|
||||||
@ -57,6 +57,7 @@ def run_ray_tune(
|
|||||||
except (ImportError, AssertionError):
|
except (ImportError, AssertionError):
|
||||||
wandb = False
|
wandb = False
|
||||||
|
|
||||||
|
checks.check_version(ray.__version__, "<=2.9.3", "ray")
|
||||||
default_space = {
|
default_space = {
|
||||||
# 'optimizer': tune.choice(['SGD', 'Adam', 'AdamW', 'NAdam', 'RAdam', 'RMSProp']),
|
# 'optimizer': tune.choice(['SGD', 'Adam', 'AdamW', 'NAdam', 'RAdam', 'RMSProp']),
|
||||||
"lr0": tune.uniform(1e-5, 1e-1),
|
"lr0": tune.uniform(1e-5, 1e-1),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user