当前位置:首页 » 《随便一记》 » 正文

处理 Runtime Error: one of the variables needed for gradient computation has been

24 人参与  2023年04月10日 10:09  分类 : 《随便一记》  评论

点击全文阅读


两次遇到这个问题,记录一下

1、反向传播时报错,参考 在用pytorch跑生成对抗网络的时候,出现错误Runtime Error: one of the variables needed for gradient computation has been_qq_33093927的博客-CSDN博客最近在看GAN,遇到了些问题,发现是前人踩过的坑,确实帮到了我,集中整理下吧目录问题环境配置解决过程总结问题在用pytorch跑生成对抗网络的时候,出现错误Runtime Error: one of the variables needed for gradient computation has been modified by an inplace operation,特记录排坑记录。环境配置windows10 2004python 3.7.4pytorch 1https://blog.csdn.net/qq_33093927/article/details/124063916?spm=1001.2101.3001.6650.5&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-5-124063916-blog-125728708.pc_relevant_recovery_v2&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-5-124063916-blog-125728708.pc_relevant_recovery_v2&utm_relevant_index=6核心就是把optimizer.step()挪到梯度计算的后面

2、反向传播前的计算报错,参考里面第三点

Pytorch报错:one of the variables needed for gradient computation has been modified by an inplace operation - lzp的bky - 博客园其中使用一个pytorch写的模型时,报错:RuntimeError:one of the variables needed for gradient computation has been modifhttps://www.cnblogs.com/liangzp/p/9207979.html


点击全文阅读


本文链接:http://zhangshiyu.com/post/59104.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

关于我们 | 我要投稿 | 免责申明

Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1