This commit is contained in:
Glenn Jocher 2019-07-30 18:25:53 +02:00
parent e8303a366f
commit 9ef8d42f0e
1 changed files with 4 additions and 4 deletions

View File

@ -153,7 +153,7 @@ def train(cfg,
# lf = lambda x: 10 ** (hyp['lrf'] * x / epochs) # exp ramp
# lf = lambda x: 1 - 10 ** (hyp['lrf'] * (1 - x / epochs)) # inverse exp ramp
# scheduler = lr_scheduler.LambdaLR(optimizer, lr_lambda=lf)
scheduler = lr_scheduler.MultiStepLR(optimizer, milestones=[round(opt.epochs * x) for x in [0.8]], gamma=0.1)
scheduler = lr_scheduler.MultiStepLR(optimizer, milestones=[round(opt.epochs * x) for x in [0.8, 0.9]], gamma=0.1)
scheduler.last_epoch = start_epoch - 1
# # Plot lr schedule
@ -333,9 +333,9 @@ def train(cfg,
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--epochs', type=int, default=100, help='number of epochs')
parser.add_argument('--batch-size', type=int, default=16, help='batch size')
parser.add_argument('--accumulate', type=int, default=4, help='number of batches to accumulate before optimizing')
parser.add_argument('--epochs', type=int, default=273, help='number of epochs')
parser.add_argument('--batch-size', type=int, default=32, help='batch size')
parser.add_argument('--accumulate', type=int, default=2, help='number of batches to accumulate before optimizing')
parser.add_argument('--cfg', type=str, default='cfg/yolov3-spp.cfg', help='cfg file path')
parser.add_argument('--data', type=str, default='data/coco_64img.data', help='coco.data file path')
parser.add_argument('--multi-scale', action='store_true', help='train at (1/1.5)x - 1.5x sizes')