mirror of
https://github.com/THU-MIG/yolov10.git
synced 2025-05-23 13:34:23 +08:00
Update Tuner() attempt metrics save on crash (#6711)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
16639b60eb
commit
4425abce59
@ -180,8 +180,9 @@ class Tuner:
|
||||
try:
|
||||
# Train YOLO model with mutated hyperparameters (run in subprocess to avoid dataloader hang)
|
||||
cmd = ['yolo', 'train', *(f'{k}={v}' for k, v in train_args.items())]
|
||||
assert subprocess.run(cmd, check=True).returncode == 0, 'training failed'
|
||||
return_code = subprocess.run(cmd, check=True).returncode
|
||||
metrics = torch.load(ckpt_file)['train_metrics']
|
||||
assert return_code == 0, 'training failed'
|
||||
|
||||
except Exception as e:
|
||||
LOGGER.warning(f'WARNING ❌️ training failure for hyperparameter tuning iteration {i + 1}\n{e}')
|
||||
|
Loading…
x
Reference in New Issue
Block a user