Recover active training loop checkpoints
This commit is contained in:
@@ -85,6 +85,13 @@ def test_failed_iteration_builds_train_only_sampling_for_next_checkpoint(tmp_pat
|
||||
assert command[command.index("--output-dir") + 1].endswith("failure-driven-training")
|
||||
|
||||
|
||||
def test_partial_iteration_resume_uses_exact_checkpoint_and_cuda(tmp_path: Path) -> None:
|
||||
checkpoint = tmp_path / "runs" / "iteration-002" / "weights" / "last.pt"
|
||||
assert MODULE.resumable_training_command("yolo", checkpoint) == [
|
||||
"yolo", "train", f"resume={checkpoint}", "device=0"
|
||||
]
|
||||
|
||||
|
||||
def test_dry_run_can_gate_existing_checkpoint_without_training(tmp_path: Path) -> None:
|
||||
audit = tmp_path / "audit.json"
|
||||
audit.write_text(json.dumps({
|
||||
@@ -107,7 +114,9 @@ def test_dry_run_can_gate_existing_checkpoint_without_training(tmp_path: Path) -
|
||||
], capture_output=True, text=True, check=False,
|
||||
)
|
||||
assert result.returncode == 0
|
||||
assert json.loads(result.stdout) == {"training_command": None, "evaluate_existing": True}
|
||||
assert json.loads(result.stdout) == {
|
||||
"training_command": None, "evaluate_existing": True, "resume_partial": False
|
||||
}
|
||||
|
||||
|
||||
def test_existing_checkpoint_iteration_directory_can_be_created_without_yolo(tmp_path: Path) -> None:
|
||||
|
||||
Reference in New Issue
Block a user