We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 872e544 commit c4c2fdcCopy full SHA for c4c2fdc
tools/train.py
@@ -7,7 +7,7 @@
7
8
import mmcv
9
import torch
10
-from mmcv.runner import init_dist
+from mmcv.runner import get_dist_info, init_dist
11
from mmcv.utils import Config, DictAction, get_git_hash
12
13
from mmseg import __version__
@@ -94,6 +94,9 @@ def main():
94
else:
95
distributed = True
96
init_dist(args.launcher, **cfg.dist_params)
97
+ # gpu_ids is used to calculate iter when resuming checkpoint,
98
+ _, world_size = get_dist_info()
99
+ cfg.gpu_ids = range(world_size)
100
101
# create work_dir
102
mmcv.mkdir_or_exist(osp.abspath(cfg.work_dir))
0 commit comments