Skip to content

Commit dcf8073

Browse files
authored
Simplify and fix --save-period epoch 0 (#8042)
Simplify and update `--save-period` epoch 0
1 parent 632559b commit dcf8073

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ def train(hyp, opt, device, callbacks): # hyp is path/to/hyp.yaml or hyp dictio
423423
torch.save(ckpt, last)
424424
if best_fitness == fi:
425425
torch.save(ckpt, best)
426-
if (epoch > 0) and (opt.save_period > 0) and (epoch % opt.save_period == 0):
426+
if opt.save_period > 0 and epoch % opt.save_period == 0:
427427
torch.save(ckpt, w / f'epoch{epoch}.pt')
428428
del ckpt
429429
callbacks.run('on_model_save', last, epoch, final_epoch, best_fitness, fi)

0 commit comments

Comments
 (0)