Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Jun 30, 2020
2 parents 4e62eb9 + 5c1c73e commit 0a08375
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,13 @@ def train(hyp):
with open(results_file, 'w') as file:
file.write(ckpt['training_results']) # write results.txt

# epochs
start_epoch = ckpt['epoch'] + 1
assert opt.epochs > start_epoch, '%s has already trained %g epochs. --epochs must be greater than %g' % \
(opt.weights, ckpt['epoch'], ckpt['epoch'])
if epochs < start_epoch:
print('%s has been trained for %g epochs. Fine-tuning for %g additional epochs.' %
(opt.weights, ckpt['epoch'], epochs))
epochs += ckpt['epoch'] # finetune additional epochs

del ckpt

# Mixed precision training https://github.com/NVIDIA/apex
Expand Down Expand Up @@ -166,7 +170,7 @@ def train(hyp):

# Testloader
testloader = create_dataloader(test_path, imgsz_test, batch_size, gs, opt,
hyp=hyp, augment=False, cache=opt.cache_images, rect=True)[0]
hyp=hyp, augment=False, cache=opt.cache_images, rect=True)[0]

# Model parameters
hyp['cls'] *= nc / 80. # scale coco-tuned hyp['cls'] to current dataset
Expand Down

0 comments on commit 0a08375

Please sign in to comment.