DDP update

This commit is contained in:
thomwolf
2019-06-18 12:06:26 +02:00
parent 2ef5e0de87
commit a59abedfb5

View File

@@ -907,7 +907,7 @@ def main():
# except ImportError:
# raise ImportError("Please install apex from https://www.github.com/nvidia/apex to use distributed and fp16 training.")
model = torch.nn.parallel.DistributedDataParallel(model)
model = torch.nn.parallel.DistributedDataParallel(model, device_ids=[args.local_rank], output_device=args.local_rank)
elif n_gpu > 1:
model = torch.nn.DataParallel(model)