Simplify and update `--save-period` epoch 0modifyDataloader
torch.save(ckpt, last) | torch.save(ckpt, last) | ||||
if best_fitness == fi: | if best_fitness == fi: | ||||
torch.save(ckpt, best) | torch.save(ckpt, best) | ||||
if (epoch > 0) and (opt.save_period > 0) and (epoch % opt.save_period == 0): | |||||
if opt.save_period > 0 and epoch % opt.save_period == 0: | |||||
torch.save(ckpt, w / f'epoch{epoch}.pt') | torch.save(ckpt, w / f'epoch{epoch}.pt') | ||||
del ckpt | del ckpt | ||||
callbacks.run('on_model_save', last, epoch, final_epoch, best_fitness, fi) | callbacks.run('on_model_save', last, epoch, final_epoch, best_fitness, fi) |