mirror of
https://github.com/ultralytics/yolov5.git
synced 2025-06-03 14:49:29 +08:00
Simplify and fix --save-period
epoch 0 (#8042)
Simplify and update `--save-period` epoch 0
This commit is contained in:
parent
632559b1e6
commit
dcf8073881
2
train.py
2
train.py
@ -423,7 +423,7 @@ def train(hyp, opt, device, callbacks): # hyp is path/to/hyp.yaml or hyp dictio
|
||||
torch.save(ckpt, last)
|
||||
if best_fitness == fi:
|
||||
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')
|
||||
del ckpt
|
||||
callbacks.run('on_model_save', last, epoch, final_epoch, best_fitness, fi)
|
||||
|
Loading…
x
Reference in New Issue
Block a user