RuntimeError: Expected to have finished reduction in the prior iteration before starting a new one. This error indicates that your module has parameters that were not used in producing loss. You can enable unused parameter detection by passing the keyword argument find_unused_parameters=True
to torch.nn.parallel.DistributedDataParallel
, and by making sure all forward
function outputs participate in calculating loss.
定义的网络中有部分网络层没有参与前向传播,在分布式训练过程中报错。注释不用的网络层即可
定义的网络中有部分网络层没有参与前向传播
最新推荐文章于 2024-07-13 23:34:27 发布