栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

AttributeError: module ‘torch.cuda‘ has no attribtue ‘amp‘ 问题解决

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

AttributeError: module ‘torch.cuda‘ has no attribtue ‘amp‘ 问题解决

AttributeError: module 'torch.cuda' has no attribtue 'amp' 问题解决
  • AttributeError: module 'torch.cuda' has no attribtue 'amp' 问题解决

AttributeError: module ‘torch.cuda’ has no attribtue ‘amp’ 问题解决

之前没有使用过apex,所以使用apex的时候,发现报了一条错误。

AttributeError: module 'torch.cuda' has no attribtue 'amp'

经过不断的尝试,终于找到了问题的原因。原因在于torch.cuda.amp是在torch1.6版本之后才引入的,而我所使用的是torch1.4版本,自然就会报错。
我的是使用下面命令,安装1.7.1版本后问题解决。具体自己的对应cuda与版本需要查看官网pytorch进行选择对应的安装。

conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cudatoolkit=10.1 -c pytorch
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/296005.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号