Skip to content

Commit

Permalink
Add cleanup for process_group
Browse files Browse the repository at this point in the history
  • Loading branch information
NanoCode012 authored Jul 7, 2020
1 parent 2aa3301 commit 050b2a5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,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 050b2a5

Please sign in to comment.