报错:

RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [544, 768]], which is output 0 of ViewBackward, is at version 1; expected version 0 instead.

Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).

解决方法:

报错原因是因为我在搭建网络模型时,残差相加的代码是这样写的: x += y

但是在pytorch中这样写会有问题, 改成: x = x+y就好了

RuntimeError: one of the variables needed for gradient computation has been modified by an inplace相关推荐

  1. RuntimeError: one of the variables needed for gradient computation has been modified by an inplace o

    RuntimeError: one of the variables needed for gradient computation has been modified by an inplace o ...

  2. PyTorch报错“RuntimeError: one of the variables needed for gradient computation has been modified by……”

    1 问题描述 今天在写作DeepLabV3+的代码时,遇到了一个问题, 程序报错: RuntimeError: one of the variables needed for gradient com ...

  3. 排坑日记1:RuntimeError: one of the variables needed for gradient computation has been modified

    问题描述 在使用Pytorch复现DeepFill V1时,报如下错: RuntimeError: one of the variables needed for gradient computati ...

  4. 【Pytorch】RuntimeError: one of the variables needed for gradient computation has been modified by

    0.前言 最近在用Pytorch训练网络的时候出现了一个奇怪的错误,找了很久在偶然间试出了解决方法,因此记录一下,以作备忘.但具体原理还不是很清楚,也请各位大佬指教. 1.错误 RuntimeErro ...

  5. Pytorch Bug解决:RuntimeError:one of the variables needed for gradient computation has been modified

    Pytorch Bug解决:RuntimeError: one of the variables needed for gradient computation has been modified b ...

  6. one of the variables needed for gradient computation has been modified by an inplace operation

    参考:https://www.cnblogs.com/liangzp/p/9207979.html 使用一个pytorch写的模型时,报错:RuntimeError:one of the variab ...

  7. 解决一个GAN训练过程中的报错:one of the variables needed for gradient computation has been modified by an inplace

    跑一个GAN DEMO , 运行时出错. 出错代码: RuntimeError: one of the variables needed for gradient computation has be ...

  8. one of the variables needed for gradient computation has been modified by an inplace

    one of the variables needed for gradient computation has been modified by an inplace 参考:https://blog ...

  9. variables needed for gradient computation has been modified by an inplace operation

    one of the variables needed for gradient computation has been modified by an self.conf加了cuda()之后就成这样 ...

最新文章

  1. 推荐一个简单、轻量、功能非常强大的C#/ASP.NET定时任务执行管理器组件–FluentScheduler...
  2. 【MPI编程】任意节点数的蝶形求和(高性能计算)
  3. 在markdown编辑模式中打出彩色的文字
  4. postgresql数据库安装以及使用pgadmin连接postgresql数据库
  5. 251f与ips屏显示器对比_不闪屏,HDR,带鱼屏全都有,LG 29WK600宽屏显示器测评
  6. 笑到打鸣~ | 今日趣图
  7. mysql自定义函数多参数_自定义mysql函数 - 无法传递参数
  8. sql server 监视_如何在SQL Server中监视对象空间增长
  9. mean value coordinates
  10. git submodule详解
  11. 破解,汉化,越狱,解锁,为什么中国的大神总是“昙花一现”?
  12. Turbo编译码Matlab仿真解读 -- WuYufei_matlab
  13. html横线标记_html中横线怎么写代码
  14. 山东理工大学ACM平台题答案关于C语言 1580 闰年
  15. Python turtle库如何瞬间完成作图?难道只难像海龟一样慢慢爬吗?
  16. 解决IDEA运行后报找不到应用程序错误
  17. 整合SSM中jsp页面图片加载不出来问题
  18. Android手机模拟器旋转快捷键
  19. 太神了!世界上最著名的菲尔人格测试!
  20. 速看 2021-2022年23项重大网络犯罪统计数据

热门文章

  1. boost::graph::distributed用法的测试程序
  2. boost::describe模块实现枚举转字符串的测试程序
  3. boost::allocator_max_size的实例
  4. boost的chrono模块单元测试的测试程序
  5. DCMTK:简单存储服务类提供者
  6. VTK:Utilities之DataAnimationSubclass
  7. VTK:Medical之MedicalDemo1
  8. VTK:图表之InEdgeIterator
  9. OpenGL HDR色调映射的实例
  10. OpenGL CPU光线跟踪