Skip to content

Commit

Permalink
ddp bug fix
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dspgbgjd authored and facebook-github-bot committed Dec 19, 2024
1 parent 4823082 commit b1c43ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion detectron2/data/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ def _train_loader_from_config(cfg, mapper=None, *, dataset=None, sampler=None):
else:
logger.info("Using training sampler {}".format(sampler_name))
if sampler_name == "TrainingSampler":
sampler = TrainingSampler(len(dataset))
sampler = TrainingSampler(len(dataset), seed=cfg.SEED)
elif sampler_name == "RepeatFactorTrainingSampler":
repeat_factors = RepeatFactorTrainingSampler.repeat_factors_from_category_frequency(
dataset, cfg.DATALOADER.REPEAT_THRESHOLD, sqrt=cfg.DATALOADER.REPEAT_SQRT
Expand Down

0 comments on commit b1c43ff

Please sign in to comment.