Faster best.pt checkpoint saving (#9436)
This commit is contained in:
parent
ea80b14d72
commit
eed01a2cf3
1 changed files with 2 additions and 2 deletions
|
|
@ -500,9 +500,9 @@ class BaseTrainer:
|
|||
# Save last and best
|
||||
torch.save(ckpt, self.last)
|
||||
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):
|
||||
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
|
||||
def get_dataset(data):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue