Skip to content

Commit

Permalink
minor.
Browse files Browse the repository at this point in the history
  • Loading branch information
dxli94 committed Mar 22, 2022
1 parent e320f4d commit a758dbc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ def main():
# print("Start training")
start_time = time.time()
for epoch in range(0, config['max_epoch']):
if not args.evaluate:
if args.distributed:
train_loader.sampler.set_epoch(epoch)
# if not args.evaluate:
# if args.distributed:
# train_loader.sampler.set_epoch(epoch)

utils.cosine_lr_schedule(optimizer, epoch, int(config['max_epoch']), float(config['init_lr']), float(config['min_lr']))
# utils.cosine_lr_schedule(optimizer, epoch, int(config['max_epoch']), float(config['init_lr']), float(config['min_lr']))

train_stats = train(model, train_loader, optimizer, epoch, device)
# train_stats = train(model, train_loader, optimizer, epoch, device)

val_result = evaluate(model_without_ddp, val_loader, device, config)
val_result_file = utils.save_result(val_result, args.result_dir, 'val_epoch%d' % epoch,
Expand Down

0 comments on commit a758dbc

Please sign in to comment.