I am trying to use the YOLO model.tune method to tune hyperparameters using this command from the documentation:
model.tune(data="/path/to/data.yaml", epochs=30, iterations=300, optimizer="AdamW", plots=False, save=False, val=False)
I am currently using google colab and have my runtime connected to a T4 GPU. Using the command in google colab, !nvidia-smi, I can see that the google notebook is connected to the T4 GPU.
The path I am passing to to data="path/to/data.yaml"
is taken from the copy path option while left clicking on the document in the document tree in google colab.
The paths in the data.yaml file are correct and also taken from using the copy path option after left clicking on the image folders.
So I believe all my paths are correct, the path for data.yaml file and the paths inside the yaml file pointing to the image folders inside the train, test and validate folders from the downloaded data from Roboflow.
The Tuner output for every iteration shows an WARNING message. But for example in the second iteration it shows different values for the hyperparameters as if the Tuner is attempting or has changed the hyperparameters for a new test. But at each iteration the warning remains. No matter how many epochs are chosen the hyperparameters in the resulting best_hyperparameters.yaml file are always the same as the default values that the tuning process starts with.
Here is the output from the second iteration showing error message as well as some of the hyperparameter values that have been altered from the default starting values as well as the WARNING message that shows on every iteration of tuning:
Tuner: Starting iteration 2/300 with hyperparameters:
{
'lr0': 0.01039,
'lrf': 0.01,
'momentum': 0.91248,
'weight_decay': 0.0005,
'warmup_epochs': 2.83485,
'warmup_momentum': 0.8,
'box': 7.42245,
'cls': 0.5046,
'dfl': 1.5,
'hsv_h': 0.015,
'hsv_s': 0.6979,
'hsv_v': 0.3853,
'degrees': 0.0,
'translate': 0.09441,
'scale': 0.48414,
'shear': 0.0,
'perspective': 0.0,
'flipud': 0.0,
'fliplr': 0.5,
'bgr': 0.0,
'mosaic': 1.0,
'mixup': 0.0,
'copy_paste': 0.0
}
WARNING ❌️ training failure for hyperparameter tuning iteration 2
Command '[
'yolo',
'train',
'task=detect',
'mode=train',
'model=yolo11n.pt',
'data=/content/Brazil-Nut-100m-Seg-2/data.yaml',
'epochs=30',
'time=None',
'patience=100',
'batch=16',
'imgsz=640',
'save=False',
'save_period=-1',
'cache=False',
'device=None',
'workers=8',
'project=None',
'name=None',
'exist_ok=False',
'pretrained=True',
'optimizer=AdamW',
'verbose=True',
'seed=0',
'deterministic=True',
'single_cls=False',
'rect=False',
'cos_lr=False',
'close_mosaic=10',
'resume=False',
'amp=True',
'fraction=1.0',
'profile=False',
'freeze=None',
'multi_scale=False',
'overlap_mask=True',
'mask_ratio=4',
'dropout=0.0',
'val=False',
'split=val',
'save_json=False',
'save_hybrid=False',
'conf=None',
'iou=0.7',
'max_det=300',
'half=False',
'dnn=False',
'plots=False',
'source=None',
'vid_stride=1',
'stream_buffer=False',
'visualize=False',
'augment=False',
'agnostic_nms=False',
'classes=None',
'retina_masks=False',
'embed=None',
'show=False',
'save_frames=False',
'save_txt=False',
'save_conf=False',
'save_crop=False',
'show_labels=True',
'show_conf=True',
'show_boxes=True',
'line_width=None',
'format=torchscript',
'keras=False',
'optimize=False',
'int8=False',
'dynamic=False',
'simplify=True',
'opset=None',
'workspace=4',
'nms=False',
'lr0=0.01039',
'lrf=0.01',
'momentum=0.91248',
'weight_decay=0.0005',
'warmup_epochs=2.83485',
'warmup_momentum=0.8',
'warmup_bias_lr=0.1',
'box=7.42245',
'cls=0.5046',
'dfl=1.5',
'pose=12.0',
'kobj=1.0',
'label_smoothing=0.0',
'nbs=64',
'hsv_h=0.015',
'hsv_s=0.6979',
'hsv_v=0.3853',
'degrees=0.0',
'translate=0.09441',
'scale=0.48414',
'shear=0.0',
'perspective=0.0',
'flipud=0.0',
'fliplr=0.5',
'bgr=0.0',
'mosaic=1.0',
'mixup=0.0',
'copy_paste=0.0',
'copy_paste_mode=flip',
'auto_augment=randaugment',
'erasing=0.4',
'crop_fraction=1.0',
'cfg=None',
'tracker=botsort.yaml'
]' returned non-zero exit status 1.
Saved runs/detect/tune/tune_scatter_plots.png
Saved runs/detect/tune/tune_fitness.png
Here is a screenshot of the google colab notebook
Can anyone see why trying to tune hyperparameters for this data is resulting in the best parameters being the starting default values? Is the problem related to the WARNING message? What do I need to look at, change or do differently to properly tune the hyperparameters for my data in the google colab notebook?