跑github的深度学习demo时出现CUDA is *NOT* detected. Running with only CPU的解决方案

跑github的深度学习demo时出现CUDA is *NOT* detected. Running with only CPU的解决方案


最近在跑一些demo的时候出现CUDA未见测到的问题:

在这里插入图片描述
因此笔者卸载重装了两次(NVIDIA驱动+CUDA+CUDNN),还是没有解决(重装3件套过程也很曲折,心态爆炸。。),因此再仔细看了下demo的README文件,其中有一句:
在这里插入图片描述而笔者的pytorch是直接用pip install安装的,因此也是最新版本,所以报错: UserWarning: Default grid_sample and affine_grid behavior has changed to align_corners=False since 1.3.0. Please specify align_corners=True if the old behavior is desired. See the documentation of grid_sample for details.
所以打算通过

pip install torch==0.3.1 torchvision==0.2.0

进行安装,不过同样报错:

ERROR: Could not find a version that satisfies the requirement torch==0.3.1 (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2, 0.4.1, 0.4.1.post2, 1.0.0, 1.0.1, 1.0.1.post2, 1.1.0, 1.2.0, 1.3.0, 1.3.1, 1.4.0, 1.5.0, 1.5.1, 1.6.0)
ERROR: No matching distribution found for torch==0.3.1

在这里插入图片描述去了一趟torch的官网发现:
在这里插入图片描述
并没有torch0.31的python3.7版本,笔者鉴于偷懒安了一个0.4.1的版本,结果还是报错:

KeyError: 'module name can\'t contain "."'

好吧。。。还是装python3.6(网上很多教程)。
**

最终的解决方案

**
1、安装python3.6设置为默认(包括安装所有需要的包);
2、通过命令

pip install torch==0.3.1 torchvision==0.2.0

安装torch0.3.1;
3、大功告成
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值