DDP数据shuffle的设置使用DDP要给dataloader传入sampler参数(torch.utils.data.distributed.DistributedSampler(dataset,num_replicas=None,rank=None,shuffle=True,seed=0,drop_last=False))。默认shuffle=True,但按照pytorchDistributedSampler的实现:def__iter__(self)->Iterator[T_co]:ifself.shuffle:#deterministicallyshufflebasedonepochandseedg=torch.G...
继续阅读 >