Torch not compiled with CUDA enabled 解决办法

目标

解决Torch not compiled with CUDA enabled 版本不兼容问题

原理

Torch not compiled with CUDA enabled,即CUDA、torch的版本兼容问题是造成print(torch.cuda.is_available()) 返回false的一种原因。本文搜集从卸载CUDA、torch,选择兼容版本,再到使用清华源,最后安装CUDA、torch的博客集合,作为解决方法:
如何查看torch版本:https://blog.csdn.net/weixin_47414034/article/details/124632748
如何查看cuda版本:https://blog.csdn.net/weixin_38723958/article/details/123143521

卸载torch:https://blog.csdn.net/zaf0516/article/details/103927989
卸载CUDA:https://blog.csdn.net/Zinnir/article/details/122766367

安装 PyTorch 切换清华源镜像:https://blog.csdn.net/weixin_44589540/article/details/122847278

Python配置清华镜像源_视觉闫小亘的博客-CSDN博客_python清华镜像源
CUDA历史版本下载:https://developer.nvidia.com/cuda-toolkit-archive
PYTORCH历史版本下载:https://pytorch.org/get-started/previous-versions/
PYTORCH版本建议按照网页上的CUDA版本匹配下载对应的版本

import torch

print(torch.__version__)#torch版本

print(torch.cuda.is_available())#GPU是否可用

感谢以上博文的作者

Original: https://blog.csdn.net/weixin_42478488/article/details/125304630
Author: lznext
Title: Torch not compiled with CUDA enabled 解决办法

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/716051/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球