Skip to content

Commit

Permalink
Merge branch 'feature/DDP_fixed' of https://github.com/MagicFrogSJTU/…
Browse files Browse the repository at this point in the history
…yolov5 into feature/DDP_fixed
  • Loading branch information
yizhi.chen committed Jul 7, 2020
2 parents d0326e3 + 82a6182 commit ec2dc6c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def train(hyp, tb_writer, opt, device):

# Print
if opt.local_rank in [-1, 0]:
# TODO: all_reduct mloss if in DDP mode.
# TODO: all_reduce mloss if in DDP mode.
mloss = (mloss * i + loss_items) / (i + 1) # update mean losses
mem = '%.3gG' % (torch.cuda.memory_cached() / 1E9 if torch.cuda.is_available() else 0) # (GB)
s = ('%10s' * 2 + '%10.4g' * 6) % (
Expand Down Expand Up @@ -400,6 +400,7 @@ def train(hyp, tb_writer, opt, device):
if not opt.evolve:
plot_results() # save as results.png
print('%g epochs completed in %.3f hours.\n' % (epoch - start_epoch + 1, (time.time() - t0) / 3600))
dist.destroy_process_group() if device.type != 'cpu' and torch.cuda.device_count() > 1 else None
torch.cuda.empty_cache()
return results

Expand Down

0 comments on commit ec2dc6c

Please sign in to comment.