pytorch报错

pytorch报错,第1张

Variable._execution_engine.run_backward(
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [32, 50, 180]], which is output 0 of AddBackward0, 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).

记录一下这个错误,查了无数博客,发现最后问题就只是一个q*=修改为q = q self.scaling就解决了

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/869172.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-13
下一篇 2022-05-13

发表评论

登录后才能评论

评论列表(0条)

保存