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

相关推荐
CICI131414137 分钟前
自动化焊接机器人厂家哪家好?
人工智能·机器人·自动化
ZzzZ3141592617 分钟前
【无标题】
人工智能
Hcoco_me19 分钟前
大模型面试题19:梯度消失&梯度爆炸 纯白话文版
人工智能·rnn·深度学习·自然语言处理·word2vec
哈__20 分钟前
CodeLlama与昇腾NPU的实践之旅
人工智能·gitcode·sglang
GMICLOUD35 分钟前
GMI Cloud@AI周报 | MiniMax 叩响港股大门;智谱 GLM-4.7 开源
人工智能·ai资讯
0x000740 分钟前
进击的智谱 - GLM 4.7 双旦大礼
人工智能
_codemonster1 小时前
AI大模型入门到实战系列--使用Pytorch实现transformer文本分类
人工智能·pytorch·transformer
Elastic 中国社区官方博客1 小时前
Elasticsearch:在 X-mas 吃一些更健康的东西
android·大数据·数据库·人工智能·elasticsearch·搜索引擎·全文检索
DKHZ_OfficeAI1 小时前
开启AI办公新时代:Office+WPS双平台智能助手全面赋能
人工智能
Coder_Boy_1 小时前
基于SpringAI的智能平台基座开发-(四)
java·人工智能·spring boot·langchain·springai