From 050b2a5a79a89c9405854d439a1f70f892139b1c Mon Sep 17 00:00:00 2001 From: NanoCode012 Date: Tue, 7 Jul 2020 12:38:14 +0700 Subject: [PATCH] Add cleanup for process_group --- train.py | 1 + 1 file changed, 1 insertion(+) diff --git a/train.py b/train.py index 7eaedf5ecdf0..27c83cd7e56a 100644 --- a/train.py +++ b/train.py @@ -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