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


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部