Torch not compiled with CUDA enabled

AssertionError:torch not compiled with cuda enabled anaconda里除了有python包之外(我们下载python可不就下载的这个包吗),还集成了很多数据分析用的包,不用我们再一一安装了。 如果在path里配置了anaconda的环境变量,anaconda prompt 和 cmd并无太大差别,只不过anaconda prompt更方便,更好用,有很多快捷键。 anaconda创建环境,激活,就可以在这个环境中下载需要的包的版本,即使与别的环境的版本冲突问题也被anaconda解决了,就这样用anaconda来管理不同的python环境。 在微信读书 阅读详情

最近接触chatglm3对话预训练模型,从git上下载,装包装半天,最后终于跑起来了,但是一对他进行对话,后台就开始报错了

File "E:\Python311\Lib\site-packages\torch\nn\modules\linear.py", line 114, in forward return F.linear(input, self.weight, self.bias)

反正大概是torch这个包有问题,于是就单独写个torch的代码执行一下,代码如下:

import torch
print("是否可用:", torch.cuda.is_available())        # 查看GPU是否可用
print("GPU数量:", torch.cuda.device_count())        # 查看GPU数量
print("torch方法查看CUDA版本:", torch.version.cuda)  # torch方法查看CUDA版本
print("GPU名称:", torch.cuda.get_device_name())    # 根据索引号得到GPU名称
print("GPU索引号:", torch.cuda.current_device())    # 查看GPU索引号

然后就报错:说我的GPU显卡不可用

报错信息1: Torch not compiled with CUDA enabled

搜了一下大概是说CUDA不可用

咱就说一个硬件小白,完全不知道是啥情况,搜了一下解决办法也是说用NVIDIA驱动更新一下CUDA版本的与你电脑的GPU版本一致

电脑终端输入了一下:nvidia-smi

又执行报错了,说电脑没有nvidia-smi

于是又搜索了一下是要我去nvidia官网去下载一个nvidia驱动

那么到了下载的时候要选择对应的类型、系列啥的要与电脑的显卡匹配

找了一下根本没有我这个型号的

后来才发现

nvidia是有自己的nvidia显卡,然而我电脑的显卡是intel的

nvidia的驱动只能给nvidia的显卡用

那么这条路就断了

于是直接搜什么可以装CUDA

一搜才知道CUDA是卡厂商NVIDIA推出的运算平台

破案了,intel目前还没有在任何一款GPU中支持CUDA驱动程序

看有些大佬是通过租用服务器实现的

太难了,难道就没人更新一下chatglm3文档吗,跟咱们小白说一下chatglm3不支持intel开发嘛

补充:后来找到了一篇文章,很仔细的教我们怎么搭建chatglm

如何在云服务器上搭建ChatGLM - lukeewin的博客

成功解决:AssertionError: Torch not compiled with CUDA enabled 在运行pycharm项目的时候,出现了AssertionError: Torch not compiled with CUDA enabled,主要可以归结于以下两个个方面: 1、没有安装GPU版本的pytorch,只是使用清华的镜像地址下载了CPU版本的pytorch 2、安装的CUDA和安装的pytorch的版本不相互对应 阅读详情

相关推荐

Torch not compiled with CUDA enabled问题解决过程记录

运行大模型的时候,出现错误:Torch not compiled with CUDA enabled原因:并不是电脑安装了nvdia显卡驱动就可以的,还需要安装另外还需要确保安装的python是GPU版本的。通常是CPU版本的。

OkGogooXSailboat的博客 1万+

pytorch错误——Torch not compiled with CUDA enabled

在Mac上面调试textCNN 分类模型,在调试时发现运行到这一句报错: 报错内容为: Torch not compiled with CUDA enabled 调查发现, 是跟pytorch和cuda版本不兼容有关, 但是我想到我的mac上并没有显卡,所以这里不应该这么调用cuda,只需要指定下使用cpu。 device = torch.device('cpu') s = torch.from_numpy(ndarray).long().to(device) 完结。。。 ...

XD的博客 5187

Python&aconda系列:Torch not compiled with CUDA enabled 报错的归纳总结

Torch not compiled with CUDA enabled 报错的归纳总结

weixin_54626591的博客 7382

torch报错AssertionError: Torch not compiled with CUDA enabled解决方法 torch适配CUDA降版本、选择gpu版本最终方案

torch适配CUDA降版本、选择gpu版本最终方案 torch报错RuntimeError: The NVIDIA driver on your system is too old (found version 10020). 以及AssertionError: Torch not compiled with CUDA enabled解决方法

当年月明的博客 8万+

成功解决raise AssertionError(“Torch not compiled with CUDA enabled“)AssertionError: Torch not compiled

成功解决raise AssertionError("Torch not compiled with CUDA enabled") AssertionError: Torch not compiled with CUDA enabled 目录 解决问题 解决思路 解决方法 解决问题 File "F:\File_Anaconda\project_py37\envs\lib\site-packages\torch\cuda\__init__.py", line 208, i.

头部AI社区如有邀博主AI主题演讲请私信—心比天高,仗剑走天涯,保持热爱,奔赴向梦想!低调,专注,谦虚,自律,反思,成长,还算比较正能量的博主,公益免费传播…内心特别想在AI界做出一些可以推进历史进程影响力的技术(兴趣使然,有点小情怀,也有点使命感呀 1万+

成功解决TypeError: type torch.cuda.HalfTensor not available. Torch not compiled with CUDA enabled.

​ 成功解决TypeError: type torch.cuda.HalfTensor not available. Torch not compiled with CUDA enabled. 目录 解决问题 解决思路 解决方法 解决问题 _C._set_default_tensor_type(t) TypeError: type torch.cuda.HalfTensor not available. Torch not compiled with CUDA enabled. 解决思

头部AI社区如有邀博主AI主题演讲请私信—心比天高,仗剑走天涯,保持热爱,奔赴向梦想!低调,专注,谦虚,自律,反思,成长,还算比较正能量的博主,公益免费传播…内心特别想在AI界做出一些可以推进历史进程影响力的技术(兴趣使然,有点小情怀,也有点使命感呀 3251

报错:Torch not compiled with CUDA enabled看这一篇就足够了

报错:Torch not compiled with CUDA enabled看这一篇就足够了

weixin_72056722的博客 9万+

YOLOv8n行人检测实战:从数据集准备到模型训练

本文详细介绍了使用YOLOv8n进行行人检测的完整流程。首先阐述了YOLOv8的优势:高速推理(300+FPS)、更高精度、易用性和轻量化(仅6MB)。接着通过Docker搭建GPU训练环境,配置32GB共享内存避免数据加载问题,并安装必要的框架和OpenCV组件。数据集采用COCO2017标注格式,包含归一化坐标的YOLO标签文件。通过可视化脚本验证标注准确性后,提出多数据集融合训练策略以增强模型泛化能力。最后使用Ultralytics框架启动训练,展现了从环境搭建到模型训练的完整技术路径。该方案兼顾检测

Hi20240217的博客 1098

python安装cuda出现错误提示:AssertionError: Torch not compiled with CUDA enabled

在pycharm中模型训练时,出现错误提示:AssertionError: Torch not compiled with CUDA enabled原因:CUDA和Torch版本不兼容。

-7的博客 3万+

利用gprMax与Matlab实现SFCW雷达信号的高效仿真与优化

本文详细介绍了如何结合gprMax与Matlab实现SFCW雷达信号的高效仿真与优化。通过利用gprMax获取地下场景的冲激响应,并在Matlab中运用卷积与信号处理技术,可大幅提升SFCW雷达系统仿真的效率与灵活性,为探地雷达研究与设计提供强大工具。

book8的博客 710

图生文【学习中】

图生文:提供图像,把图像对应的信息用文本描述出来

qq_19072921的博客 1787

解决AssertionError Torch not compiled with CUDA enabled问题

解决AssertionError: Torch not compiled with CUDA enabled问题 一、前言 考虑到:①pycharm比Spyder功能全面,②anaconda的环境配置方便,这两个因素,所以想要在pycharm 上引入conda environment,充分利用Anaconda的库函数。 但是pycharm导入Anaconda环境后,运行程序,报错,AssertionError: Torch not compiled with CUDA enabled 二、分析问题 1.查看

qq_46941656的博客 17万+

Codex 100个真实案例 - 用AI批量清洗Excel脏数据(10万行3分钟搞定)

每个做数据分析的人都被"脏数据"折磨过——空值、重复行、日期格式五花八门、手机号多一位少一位……手动清洗几千行就已经让人崩溃,更别提10万行了。本文将展示如何用 Codex 生成一套完整的 Python pandas 数据清洗工具,从读取Excel/CSV、识别脏数据、自动清洗、生成清洗报告,到可视化对比清洗前后的数据质量,全程自然语言驱动,10万行数据3分钟搞定!

yueyeguzhuo的专栏 89

关于 AssertionError: Torch not compiled with CUDA enabled 问题

文章介绍了如何解决使用 ComfyUI 安装过程中出现的 "AssertionError: Torch not compiled with CUDA enabled" 错误,重点讲解了 CUDA 和 Intel(R) Lris(R) Xe Graphics 的概念,以及解决该错误的具体步骤。

shengjk1的博客 2678

Palantir 凭什么两年涨 20 倍?深度解析解决 AI 幻觉的 “本体论“ 核心原理

本文深度解析了Palantir本体(Ontology)的核心原理及其在企业AI应用中的革命性价值。本体通过构建结构化的语义层与动态执行层,将企业分散的数字资产(数据集、虚拟表、模型)映射为现实世界的数字孪生,使大模型能够在**严格的业务规则与数据边界内**进行推理与决策,从而从架构层面彻底解决AI幻觉问题。这一技术架构不仅帮助Palantir实现股价两年增长20倍、市值突破4000亿美金的商业成功,更成为SAP、Salesforce等ERP巨头争相模仿的下一代企业智能标准范式。通过航空业飞机故障应急处理等实

program哲学 237

知识存储之Apache Jena

知识图谱的存储可以分为基于表结构的存储和基于图结构的存储。1️⃣基于表结构的存储基于表结构的存储利用二维的数据表对知识图谱中的数据进行存储。根据不同的设计原则,知识图谱可以具有不同的表结构:💨知识图谱实质上是一个个的三元组,一种简单直接的存储方式是设计一张三元组表用于存储所有三元组,有不少比较成熟的产品利用该形式存储知识图谱,包括Jena、Oracle、Virtuoso等。💨为每种类型构建一张表,同一类型的实例存放在相同的表中。

Puzzle的博客 6065

AssertionError:Torch not compiled with CUDA enabled

AssertionError:Torch not compiled with CUDA enabled

weixin_44340927的博客 9140

如何使用 SAP ABAP Development Tool 连接 SAP BTP 上的免费 ABAP 编程环境

在云端环境编写 ABAP 代码会遇到一些限制,比如你无法在云端 ABAP 编程环境进行发生在传统 SAPGUI 里的 Dynpro 和 Screen 编程。部分在 SAPGUI 里使用的 List 处理相关的关键字比如 WRITE,还有 CALL TRANSACTION 等代码,也无法在云端使用。 当然如果大家觉得上面提到的这些限制不会影响自己的 ABAP 学习,就可以继续本文的阅读,使用 ABAP Development Tool 登录云端的 ABAP 编程环境。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 1521

关于Torch not compiled with CUDA enabled的错误解决

这个问题我们经常在很多开源的AI工具编译或运行的时候遇到。本文精简扼要的说明原因和解决情况。首先最重要的,希望你用conda或者python创建一个独立的venv环境。这样可以确保没有干扰。

ms44的专栏 1711

RK3588网卡出现丢包或者带宽不足的问题验证排查

注意除了有最大的TCP数据接收缓冲,还有/proc/sys/net/core/wmem_max — 最大的TCP数据发送缓冲可以调整,这里暂时没用到,针对具体需要可适当调整。比如把ethx接口中断从默认的cpu0迁移到其它cpu,例如将eth0中断234移到cpu7 (10是16进制, cpu0 =3588的cpu有8个核,4个A55(小核)+4个A76(大核),可以找到对应中断 将中断从默认cpu0核切到cpu7。tcp_rmem:单位是字节,接收缓存区大小,缓存从对端接收的数据,后续会被应用程序读取。

Android/Linux驱动开发传帮带学习,让驱动入门门槛更低! 2031

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

Pytorch错误:Torch not compiled with CUDA enabled

  在用Pytorch炼丹的过程中,很意外地碰到了一个错误提示AssertionError: Torch not compiled with CUDA enabled,如下图所示。 错误提示   代码本身可以确定是没有问题的,因为只是在往日已经跑过的代码上加入了小改动。最后发现问题出现在Pytorch和CUDA版本不兼容的问题上。问题的发现可以在终端中输入'python'命令,运行python后...

噢啦啦耶的博客 36万+

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

AssertionError: Torch not compiled with CUDA enabled

解决问题:AssertionError: Torch not compiled with CUDA enabled

weixin_45972980的博客 1万+

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

torch报错AssertionError: Torch not compiled with CUDA enabled解决方法

AssertionError: Torch not compiled with CUDA enabled

2301_77428449的博客 2701
上一篇: 自定义element ui主题色
下一篇: pip 安装错误集合
RubyLinT
博客等级 码龄9年 31粉丝 96原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值