【解决警告】多卡DDP分布式训练报错Warning: find_unused_parameters=True was specified in DDP constructor, but did not

警告内容

Warning: find_unused_parameters=True was specified in DDP constructor, but did not find any unused parameters in the forward pass. This flag results in an extra traversal of the autograd graph every iteration,  which can adversely affect performance. If your model indeed never has any unused parameters in the forward pass, consider turning this flag off. Note that this warning may be a false positive if your model has flow control causing later iterations to have unused parameters. (function operator())

警告原因

这个警告来自于 PyTorch 中的分布式数据并行(DDP)设置,主要提醒用户在使用 DDP 构造函数时设置了 find_unused_parameters=True,但在前向传播过程中没有找到任何未使用的参数。

解决方法

warning不碍事,find_unused_parameters的默认值就是True,功能可以理解为检查网络前向传播过程中是否有未使用到的参数,最好不要修改!下面的解释可以不看!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

一只菟葵

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值