发布时间: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
感觉应该是变量是否存在梯度的问题,可能第一层的一开始的输出不能被梯度吧,需要再看看这些个变量的问题。
自用,不保证对错。
Q-learning算法辅助求解柔性作业车间调度问题--附带源码测试集模型
解决TypeError: Cannot read properties of undefined (reading ‘NormalModule‘)的三种方案
微信小程序:王者改名微信小程序源码下载另一版本支持流量主收益
基于yolov4作者最新力作yolov7目标检测模型实现火点烟雾检测
从零开始完整开发基于websocket的在线对弈游戏【五子棋】,只用几十行代码完成全部逻辑。
【报错】FileNotFoundError: [Errno 2] No such file or directory
ios mysql注册登录界面_Vue+Vue Router+Axios+Webpack+Flask+MySQL实现简单的注册、登录验证功能...