|
|
@ -500,9 +500,9 @@ class BaseTrainer: |
|
|
|
# Save last and best |
|
|
|
# Save last and best |
|
|
|
torch.save(ckpt, self.last) |
|
|
|
torch.save(ckpt, self.last) |
|
|
|
if self.best_fitness == self.fitness: |
|
|
|
if self.best_fitness == self.fitness: |
|
|
|
torch.save(ckpt, self.best) |
|
|
|
self.best.write_bytes(self.last.read_bytes()) # copy last.pt to best.pt |
|
|
|
if (self.save_period > 0) and (self.epoch > 0) and (self.epoch % self.save_period == 0): |
|
|
|
if (self.save_period > 0) and (self.epoch > 0) and (self.epoch % self.save_period == 0): |
|
|
|
torch.save(ckpt, self.wdir / f"epoch{self.epoch}.pt") |
|
|
|
(self.wdir / f"epoch{self.epoch}.pt").write_bytes(self.last.read_bytes()) # copy last.pt to i.e. epoch3.pt |
|
|
|
|
|
|
|
|
|
|
|
@staticmethod |
|
|
|
@staticmethod |
|
|
|
def get_dataset(data): |
|
|
|
def get_dataset(data): |
|
|
|