[Pytorch]: 错误汇总
2017-07-26 11:18
92 查看
关于自定义后向传播错误
Traceback (most recent call last): File "/xxx/xxx/xxx.py", line 217, in <module> output = L.forward(x, label) File "/xxx/xxx/xxx.py", line 201, in forward return xxx()(input, target, self.weight) RuntimeError: save_for_backward can only save input or output tensors, but argument 2 doesn't satisfy this condition
分析:出现这个错误是我在forward中改变了weight这个变量,
weight=weight.div(scalar),这导致参数不符合
save_for_backward的要求。
解决:在forward中要改变weight的值可以使用就地运算
weight.div_(scalar)。这样即改变也weight的值,又不改变原本的指向。
遇到其它问题会更行,待续…
相关文章推荐
- ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:748) Pytorch下载VGG时的错误
- Pytorch图像分割BUG心得汇总(一)
- Pytorch 读取参数错误 RuntimeError: cuda runtime error (10) : invalid device ordinal
- 深度学习:pytorch常见错误总结
- HTTP 头部信息和错误码汇总详细解释
- 在python中运行selective-search.py出现no module named numpy错误
- WinCE6编译错误汇总-遇到即更新
- iOS错误汇总 Implicit declaration of function - C99 完美解决
- pytorch初学(1)(安装及入门)
- 【乱整理】KEIL编译错误,ERROR代码分析解决汇总~
- android 开发常见错误汇总系列
- 【学习Android遇到的错误】conversion to dalvik format failed with error 1的解决办法汇总
- 升级U8 错误汇总
- 将Caffe Model转化为Pytorch Model以及Torch Model
- Pytorch常用函数积累
- pytorch学习_2
- IIS错误代码列表汇总之(一)
- FindBugs 错误信息汇总
- IOS各类错误汇总
- pytorchversion.transform 整理