发布时间:2024-08-17 14:01
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [128, 3, 4, 4]] is at version 2; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).
在做stackGAN时候的问题,需要把前一个网络的G的输出作为下一层的输入,一开始的时候把两个网络合在一起写的,
iuputs-》G1-》output1,训练G1,output1->G2,训练G2
这时候是不能运行的,
报错:
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [128, 3, 4, 4]] is at version 2; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).
但是后面改成了
inuts->G1->output1 ,训练G1,inuts->G1(训练后的)->output1->G2,训练G2
感觉应该是变量是否存在梯度的问题,可能第一层的一开始的输出不能被梯度吧,需要再看看这些个变量的问题。
自用,不保证对错。
Deep Neural Networks for Learning Graph Representations——paper 笔记
Attention Is All You Need----Transformer
计算机视觉项目实战-图像特征检测harris、sift、特征匹配
Java中的方法覆盖(Overriding)和方法重载(Overloading)是什么意思?
基于 Kubernetes 和 Spring Cloud 的微服务化实践
【阅读笔记】联邦学习实战第5章——用FATE从零实现横向逻辑回归v1.8.0
客观评价 增长趋势比 vite 还猛的 TailwindCSS