Skip to content

Commit b1c43ff

Browse files
dspgbgjdfacebook-github-bot
authored andcommitted
ddp bug fix
Summary: 1. migrated to d2go lr_scheduler for 100% match 2. fixed the ddp module bug in compute loss, the loss should be computed using a ddp module, not it's child, which cause gradient to not sycn 3. added 2 configs to train from scratch Reviewed By: srihari2761 Differential Revision: D67433973 fbshipit-source-id: 53a14c02a3915746b262641808ccd3d694afb548
1 parent 4823082 commit b1c43ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

detectron2/data/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ def _train_loader_from_config(cfg, mapper=None, *, dataset=None, sampler=None):
490490
else:
491491
logger.info("Using training sampler {}".format(sampler_name))
492492
if sampler_name == "TrainingSampler":
493-
sampler = TrainingSampler(len(dataset))
493+
sampler = TrainingSampler(len(dataset), seed=cfg.SEED)
494494
elif sampler_name == "RepeatFactorTrainingSampler":
495495
repeat_factors = RepeatFactorTrainingSampler.repeat_factors_from_category_frequency(
496496
dataset, cfg.DATALOADER.REPEAT_THRESHOLD, sqrt=cfg.DATALOADER.REPEAT_SQRT

0 commit comments

Comments
 (0)