原文: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