解决办法:
添加find_unused_parameters=true
model=torch.nn.parallel.DistributedDataParallel(model,find_unused_parameters=true)
RuntimeError:Expected to have finished reduction in the prior iteration
原文:https://www.cnblogs.com/lyl0618/p/13337220.html