Add Hyperparameter evolution Tuner() class (#4599)
This commit is contained in:
parent
7e99804263
commit
4bd62a299c
15 changed files with 403 additions and 91 deletions
|
|
@ -1,6 +1,5 @@
|
|||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
import contextlib
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
|
@ -81,18 +80,23 @@ def test_predict_sam():
|
|||
|
||||
|
||||
@pytest.mark.skipif(not CUDA_IS_AVAILABLE, reason='CUDA is not available')
|
||||
def test_model_tune():
|
||||
subprocess.run('pip install ray[tune]'.split(), check=True)
|
||||
def test_model_ray_tune():
|
||||
with contextlib.suppress(RuntimeError): # RuntimeError may be caused by out-of-memory
|
||||
YOLO('yolov8n-cls.yaml').tune(data='imagenet10',
|
||||
YOLO('yolov8n-cls.yaml').tune(use_ray=True,
|
||||
data='imagenet10',
|
||||
grace_period=1,
|
||||
max_samples=1,
|
||||
iterations=1,
|
||||
imgsz=32,
|
||||
epochs=1,
|
||||
plots=False,
|
||||
device='cpu')
|
||||
|
||||
|
||||
@pytest.mark.skipif(not CUDA_IS_AVAILABLE, reason='CUDA is not available')
|
||||
def test_model_tune():
|
||||
YOLO('yolov8n.pt').tune(data='coco8.yaml', imgsz=32, epochs=1, iterations=1, device='cpu')
|
||||
|
||||
|
||||
@pytest.mark.skipif(not CUDA_IS_AVAILABLE, reason='CUDA is not available')
|
||||
def test_pycocotools():
|
||||
from ultralytics.models.yolo.detect import DetectionValidator
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue