原文:one of the variables needed for gradient computation has been modified by an inplace operation

记录一个pytorch多卡训练遇到的bug 报错如下: 这个是多卡训练时候遇到的,单卡是一切正常的 先按网上的提示,在报错的代码前加上with torch.autograd.set detect anomaly True :语句,之后它会把挂掉时候的栈显示出来,我的打出来是在batchNorm那里出的问题 搜索得到一个方案:https: discuss.pytorch.org t ddp sync ...

2021-06-02 18:28 0 2225 推荐指数:

查看详情

 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM