pytorch单机多卡训练
使用DistributedDataParallel进行单机多GPU训练,官方教程很详细了。
最后需要通过CUDA_VISIBLE_DEVICES=0,1,2,3 python -m torch.distributed.launch --nproc_per_node=2 train.py调用。
import torch
import torch.distributed as dist
torch.distributed.init_process_group(backend="nccl")
local_ran
原创
2020-06-26 21:08:39 ·
2232 阅读 ·
0 评论