Skip to content

分布式训练问题 #48

@sundonghui326-stack

Description

@sundonghui326-stack

您好,我在您的trainer.py里面看到
def _setup_training(self):
if torch.cuda.device_count() > 1:
self.model = torch.nn.DataParallel(self.model).cuda()#DataParallel自动实现:数据分片(各GPU处理不同batch),梯度聚合(各卡梯度求平均)
elif torch.cuda.is_available():
self.model.cuda()
else:
logger.info('No gpu will be used')
您这里用的是DP,但是您文论中说到批次内负样本的数量是batch_size-1,那不应该用的是DDP式训练吗,请问这里是否有点出入呢还是我理解错了论文里的描述呢?希望得到您的回复,谢谢!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions