torch.cuda.is_available()返回flase 问题排查

查看torch版本是否为GPU版本

复制代码
import torch
print(torch.__version__)    //我的是CPU版本

如果不是GPU版本下载GPU版本

  • 查看cuda版本

    nvcc --version

    nvcc: NVIDIA (R) Cuda compiler driver
    Copyright (c) 2005-2022 NVIDIA Corporation
    Built on Wed_Sep_21_10:41:10_Pacific_Daylight_Time_2022
    Cuda compilation tools, release 11.8, V11.8.89
    Build cuda_11.8.r11.8/compiler.31833905_0 //我的是11.8版本

  • 下载与cuda版本一致的pytorch

    //下载pytorch 11.8版本,去pytorch官网生成11.8对应的pytorch版本

    pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

相关推荐
深蓝AI9 分钟前
一个项目五个 AI 同时干活,Claude Code 怎么让它们不互相打架
人工智能·程序员
forest_0921 分钟前
多 Agent 协作第二课:交叉验证≠独立验证
人工智能·python·算法·机器学习·prompt·agi
ZONGYUAN-ROOT1 小时前
【工具治理】Nginx换机丢16子域事故复盘
人工智能
dozenyaoyida1 小时前
AI与大模型新闻日报 | 2026-11-08
人工智能·搜索引擎·ai·大模型·新闻
泯泷1 小时前
AI Agent 工具设计:读完一百页 PDF,不等于真的看懂了
人工智能·llm·agent
泯泷4 小时前
AI 怎样"查资料"?——RAG 检索增强生成入门(三)
人工智能·llm
Solange__4 小时前
Blender 3D模型优化:普通复制、共享网格、实例、合并怎么选?
人工智能·3d·ai·自然语言处理·编辑器·blender·材质
师夷长技以自愈4 小时前
手搓 AI Agent 第 8 篇:从手写循环到画流程图——LangGraph 封装
人工智能·python
数据治理自习室4 小时前
2026最新:MCP开发与使用指南
人工智能
小小疯狐狸4 小时前
我踩过的Agent harness几个坑:上下文越跑越慢
人工智能