多卡训练就报这个错是为什么?
收藏
单卡训练时可以,但是多卡训练就报这个错:
RuntimeError: (PreconditionNotMet) A serious error has occurred here. Please set find_unused_parameters=True to traverse backward graph in each step to prepare reduce in advance. If you have set, There may be several reasons for this error: 1) Please note that all forward outputs derived from the module parameters must participate in the calculation of losses and subsequent gradient calculations. If not, the wrapper will hang, waiting for autograd to generate gradients for these parameters. you can use detach or stop_gradient to make the unused parameters detached from the autograd graph. 2) Used multiple forwards and one backward. You may be able to wrap multiple forwards in a model.
请问是怎么回事?
0
收藏
请登录后评论
可以考虑换成静态图再试一试。
难道单卡下可以某个网络不更新权重,而多卡下就不行了么?
我的GAN模型里用的一个辅助vgg网络是用的预训练参数,不进行参数更新
那可是个大动作
貌似这种情况,需要把VGG放到GAN模型里面去。
也就是说不可以有多个模型。
我在使用paddledetection2.1时遇到过同样问题,技术人员给出的解决方法实在config中加入
find_unused_parameters: true
在pddet中可行,不知道在你的任务中是否可用
谢谢,嫁接动静也不小啊,这是模型杂交技术~~
其实gan就是杂交出来的,有时还把人家编解码器拆成两半用
嗯,报错里有这个建议,我试试
find_unused_parameters: true这个设置时ppdet里的吧,我查文档这个是 DataParallel api 的参数
是pddet哈哈,paddledetection
抗旱抗病虫的高产模型就要诞生啦,哈哈哈
我试了下,在给api加上这个参数设置还是报错
vgg19 = paddle.DataParallel(vgg19, find_unused_parameters=True)
大佬说的这个
“find_unused_parameters: true”
是在yaml文件里设置得么?
模型杂交~~
是的
谢谢,我去看看代码吧,可能改动不止数据并行那一处
兄弟我也遇到这个错误了
有印象最终是怎么解决的了吗
学到了学到了,大佬厉害