소스 검색

Simplify and fix `--save-period` epoch 0 (#8042)

Simplify and update `--save-period` epoch 0
modifyDataloader
Glenn Jocher GitHub 2 년 전
부모
커밋
dcf8073881
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. +1
    -1
      train.py

+ 1
- 1
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…
취소
저장