Skip to content

Commit 9e4ac86

Browse files
1195 add missing flag in dynunet tutorial (Project-MONAI#1196)
Signed-off-by: Yiheng Wang <[email protected]> Fixes Project-MONAI#1195 . ### Description This PR adds the missing `multi_gpu_flag` in the train script. ### Checks <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Avoid including large-size files in the PR. - [x] For security purposes, please check the contents and remove any sensitive info such as user names and private key. - [x] Ensure (1) hyperlinks and markdown anchors are working (2) use relative paths for tutorial repo files (3) put figure and graphs in the `./figure` folder Signed-off-by: Yiheng Wang <[email protected]>
1 parent 56ba738 commit 9e4ac86

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

modules/dynunet_pipeline/train.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ def validation(args):
9797
"mean dice for label {} is {}".format(i + 1, results[:, i].mean())
9898
)
9999

100-
dist.destroy_process_group()
100+
if multi_gpu_flag:
101+
dist.destroy_process_group()
101102

102103

103104
def train(args):
@@ -227,7 +228,8 @@ def train(args):
227228
trainer.logger.setLevel(logging.WARNING)
228229

229230
trainer.run()
230-
dist.destroy_process_group()
231+
if multi_gpu_flag:
232+
dist.destroy_process_group()
231233

232234

233235
if __name__ == "__main__":

0 commit comments

Comments
 (0)