fix for KeyError: 'epoch' (#48)

* fix for KeyError: 'epoch'
This commit is contained in:
Thomas Friedel 2024-05-26 04:32:05 +02:00 committed by GitHub
parent f19f3e521f
commit 2f6208c356
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -659,7 +659,7 @@ class BaseTrainer:
def resume_training(self, ckpt): def resume_training(self, ckpt):
"""Resume YOLO training from given epoch and best fitness.""" """Resume YOLO training from given epoch and best fitness."""
if ckpt is None: if ckpt is None or not self.resume:
return return
best_fitness = 0.0 best_fitness = 0.0
start_epoch = ckpt["epoch"] + 1 start_epoch = ckpt["epoch"] + 1