conda环境下print(torch.cuda.is_available()) False
分类:故障排查
26
情景是:明明pip install torch>=1.10 安装成功了,但conda环境下运行
print(torch.cuda.is_available())
却得到
False
后来通过
print(torch.__version__)
确实是安装提CPU版本而非GPU版本
找到以前另一个安装笔记使用以下安装解决
conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
但正确的处理方法应该是Pip手工安装 ,指定清楚,比如以下demo
pip install torch==1.7.1+cu101 torchvision==0.8.2+cu101 torchaudio===0.7.2
速度慢还可以用迅雷下载实际文件后 直接安装。
参考自:https://blog.csdn.net/qq_46126258/article/details/112708781
相关文章
- playwright._impl._api_types.TimeoutError: Timeout 30000ms exceeded.
- 设置xshell断开自动重连的方法
- 2023年3月亲测,恢复Google和360浏览器的翻译功能
- 华为usg防火墙ping网址unkown host,但能ping外部ip
- u盘安装Centos7报starting timeout scripts错误
- 升级DellR430 bios以点亮V4CPU
- php编译exif.so,解决Call to undefined exif_imagetype()报错
- 解决win7 打开京东提示不安全 ,WINDOWS没有足够信息,不能验证该证书的问题