AssertionError: Torch not compiled with CUDA enabled解決方案
在執行pytorch代碼的時候,突然看到報錯
AssertionError: Torch not compiled with CUDA enabled
這說明了
1. 你pytoch确实安装了
2. 你安装的是cpu版本
作为验证,你可以在python编辑器输入下列代码
解决方案
首先,安装Nvidia toolkit
sudo apt install nvidia-cuda-toolkit
然后,你需要卸载pytorch,如下图。
conda uninstall pytorch
否则,它可能只是更新不同的cpu版本,如下列截图。
然后,再安装pytoch版本。注意,请确认自己电脑对应的cuda版本。如下图,对应的11,3.
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
注意,如果执行下列指令仍安装的是cpu版本,建议参考
Previous PyTorch Versions | PyTorch三An open source machine learning framework that accelerates the path from research prototyping to production deployment.https://pytorch.org/get-started/previous-versions/
所建议的指令.
安装截图如下,可以看到,安装的都是cu版本了。
最后,作为验证。
Job Done.
AssertionError: Torch not compiled with CUDA enabled解決方案相关推荐
- AssertionError: Torch not compiled with CUDA enabled 解决方案
报错 Traceback (most recent call last):File "main_pretrain.py", line 250, in <module>m ...
- 成功解决raise AssertionError(“Torch not compiled with CUDA enabled“)AssertionError: Torch not compiled
成功解决raise AssertionError("Torch not compiled with CUDA enabled") AssertionError: Torch not ...
- AssertionError: Torch not compiled with CUDA enabled到底是什么原因
代码运行报错AssertionError: Torch not compiled with CUDA enabled 但是根据cuda安装显示 cuda是安装成功的 这是怎么回事 我先进入百度翻译 A ...
- 解决 AssertionError Torch not compiled with CUDA enabled
最近在矩池云的的Tesla K80机子上跑MMYOLO,跟着MMYOLO官方文档<自定义数据集 标注+训练+测试+部署 全流程 >操作到 "2.1.1 软件或者算法辅助" ...
- 报错 AssertionError: Torch not compiled with CUDA enabled
报错: AssertionError: Torch not compiled with CUDA enabled 本文针对仅有CPU无GPU的设备,针对该报错进行修改: 在代码开头添加: // A c ...
- AssertionError: Torch not compiled with CUDA enabled【pycharm/python3/pip】
目录 问题 查阅资料 解决步骤 1.检查pytorch版本.是否有CUDA 2.安装CUDA前看电脑的显卡驱动程序版本.支持的最高版本 3.安装CUDA和cuDNN 4.卸载pytorch 5.重新安 ...
- 问题:AssertionError: Torch not compiled with CUDA enabled
问题在于下载的torch没有cuda,即你的电脑没有GPU,无法运行 解决办法:在程序开头添加下列代码,然后在出现.cuda()的地方换成.to(device) device = torch.devi ...
- 报错:AssertionError: Torch not compiled with CUDA enabled
环境:win0+torch(cpu) 详细报错信息: 解决: 查阅资料发现此错误是由于下载的torch没有cuda,所以在运行时会报错,在程序最开始的地方加上: device = torch.devi ...
- 成功解决:AssertionError: Torch not compiled with CUDA enabled
在运行pycharm项目的时候,出现了以上的报错,主要可以归结于以下两个个方面: 1.没有安装GPU版本的pytorch,只是使用清华的镜像地址下载了CPU版本的pytorch 2.安装的CUDA和安 ...
最新文章
- 【干货】CNN与Transformer的强强联合!谷歌最新开源BoTNet,ImageNet达84.7%准确率
- c语言实现将字符串首尾*删除,C语言实现Trim()函数:删除字符串首尾空格。...
- python爬虫学习:爬虫QQ说说并生成词云图,回忆满满
- 【干货】接地气的产品设计流程
- Note cancel request的实现原理
- android放在上个元素的左边代码,控件悬浮在某个控件之上 Android五大布局方式——相对布局(RelativeLayout)属性详解...
- string赋值-单引号和双引号的区别(php)
- Sysmon勘验、分析现场(主机监控)
- Char RNN原理介绍以及文本生成实践
- iscsi:IO操作流程(三)
- 咬文嚼字:刹车错当油门酿车祸?!
- LINUX自学-初识LINUX
- 一份成功的高薪软件测试求职简历应该是这样的
- 在windows系统调试ydlidar详细记录(物联网机器人方向)
- mysql 1033_MySQL ERROR 1033 (HY000): Incorrect information in file. 处理一例
- 【论文导读】Self-Supervised Learning with Data AugmentationsProvably Isolates Content from Style
- 信息学奥赛 一本通:1194:移动路线
- 如何对比手机、买手机??
- 栾锟数据科学与计算机学院,山东女子学院学生会第四届第一任干部名单
- uva 11800 Determine the Shape