RuntimeError: Legacy autograd function with non-static forward method is deprecated. Please use new-
loss.backward报错
报错信息:RuntimeError: Legacy autograd function with non-static forward method is deprecated. Please use new-style autograd function with static forward method.
错误原因:loss.backward()回传失败,inplace设置为了True,原来的参数被覆盖了
解决方法:将inplace设置为False
...
原创
2021-01-26 19:13:16 ·
415 阅读 ·
0 评论