pytorch报错

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就解决了

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
根据提供的引用内容\[1\],可以看出在安装pytorch时出现了错误。错误信息显示找不到满足要求的torch版本,也没有找到匹配的分发版本。同时还有一个警告,检查pip的最新版本时出现了错误。 这个错误可能有几个原因导致: 1. 网络连接问题:请确保你的网络连接正常,可以尝试重新运行安装命令。 2. 源问题:你使用的源可能无法找到所需的torch版本。你可以尝试更换源,或者使用官方源进行安装。 3. 系统兼容性问题:请确保你的系统满足pytorch的最低要求。例如,某些版本的pytorch可能需要特定的操作系统或CUDA版本。 为了解决这个问题,你可以尝试以下几个步骤: 1. 检查网络连接:确保你的网络连接正常,可以尝试重新运行安装命令。 2. 更换源:尝试使用官方源进行安装,可以使用以下命令: ``` pip3 install torch torchvision torchaudio ``` 3. 检查系统兼容性:确保你的系统满足pytorch的最低要求。你可以查看pytorch官方文档或者官方网站上的系统要求。 如果问题仍然存在,请提供更多的错误信息或者尝试在相关的开发者社区或者论坛上寻求帮助。 #### 引用[.reference_title] - *1* [安装pytorch报错](https://blog.csdn.net/oHuanCheng/article/details/130065955)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值