File size: 533 Bytes
fde6d70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from ultralytics import YOLO
from pathlib import Path

if __name__ == '__main__':
    # Existing checkpoint
    checkpoint = Path(
        "/media/rtx5090/Scripts/runs/detect/training_stats/1700_train/hp-z4-g5-workstation-1/run_1/weights/last.pt"
    )

# Check that it exists
    if not checkpoint.exists():
        raise FileNotFoundError(f"Checkpoint not found: {checkpoint}")

# Load the interrupted training state
    model = YOLO(str(checkpoint))

# Resume training
    model.train(
        resume=True,
        device=0
    )