Use shell=True to run hyperparameter tuning (#18284)
Signed-off-by: Mohammed Yasin <32206511+Y-T-G@users.noreply.github.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
207c1c8319
commit
5c2ecb7669
1 changed files with 1 additions and 1 deletions
|
|
@ -191,7 +191,7 @@ class Tuner:
|
||||||
try:
|
try:
|
||||||
# Train YOLO model with mutated hyperparameters (run in subprocess to avoid dataloader hang)
|
# 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())]
|
cmd = ["yolo", "train", *(f"{k}={v}" for k, v in train_args.items())]
|
||||||
return_code = subprocess.run(cmd, check=True).returncode
|
return_code = subprocess.run(" ".join(cmd), check=True, shell=True).returncode
|
||||||
ckpt_file = weights_dir / ("best.pt" if (weights_dir / "best.pt").exists() else "last.pt")
|
ckpt_file = weights_dir / ("best.pt" if (weights_dir / "best.pt").exists() else "last.pt")
|
||||||
metrics = torch.load(ckpt_file)["train_metrics"]
|
metrics = torch.load(ckpt_file)["train_metrics"]
|
||||||
assert return_code == 0, "training failed"
|
assert return_code == 0, "training failed"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue