已解决:Torch not compiled with CUDA enabled
最近在 Linux 服务器上跑项目,要用到 Python 3.7 + Torch 1.5.0 + Cuda + Transformer。运行过程中出现报错 “Torch not compiled with CUDA enabled”,经过思考认为,应该是 Torch 和 Cuda 版本不匹配导致的,最后成功解决。
解决思路如下:
1. 检查 Nvidia & Cuda 版本,使用 Linux 指令 :
nvidia-smi
2. 登录 Nvidia 查看已安装 Nvida & Cuda 版本是否适配,若不适配,需重装Cuda;
3. 登录 Pytorch 找到与 Nvida & Cuda 适配的 Torch 版本,复制下载指令;
4. 例如,我的 Linux 服务器是 NVIDIA-SMI 418.43, 则 Cuda 10.1 与之适配. 相应地,我如果想安装 Torch 1.5.0 ,则对应的 Linux 指令为
pip install torch==1.5.0+cu101 torchvision==0.6.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
5. 希望对你有帮助!好用请点赞/ 评论 / 关注,期待与你一起交流,共同进步!
参考:AssertionError: Torch not compiled with CUDA enabled · Issue #30664 · pytorch/pytorch · GitHub
已解决:Torch not compiled with CUDA enabled相关推荐
- 成功解决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
最近在矩池云的的Tesla K80机子上跑MMYOLO,跟着MMYOLO官方文档<自定义数据集 标注+训练+测试+部署 全流程 >操作到 "2.1.1 软件或者算法辅助" ...
- Pytorch错误:Torch not compiled with CUDA enabled
一.问题 今天跑一个项目代码遇到了一个问题,大致是pytorch和CUDA版本不匹配,然后我就降低pytorch版本,结果1.7中网络不包含我所需的函数,我直接pip install pytorch= ...
- AssertionError: Torch not compiled with CUDA enabled 解决方案
报错 Traceback (most recent call last):File "main_pretrain.py", line 250, in <module>m ...
- AssertionError: Torch not compiled with CUDA enabled【pycharm/python3/pip】
目录 问题 查阅资料 解决步骤 1.检查pytorch版本.是否有CUDA 2.安装CUDA前看电脑的显卡驱动程序版本.支持的最高版本 3.安装CUDA和cuDNN 4.卸载pytorch 5.重新安 ...
- Torch not compiled with CUDA enabled 报错的归纳总结
以前总是嫌装环境太麻烦,碰到些需要用到GPU的项目都不想去复现了...这次因为论文需要,下定决心要把pytorch的安装问题搞定,但是期间遇到了很多问题,最烦人的莫过于这个' AssertionErr ...
- Torch not compiled with CUDA enabled
Torch not compiled with CUDA enabled 如果没有可用的显卡资源,则检查代码,把调用显卡资源的部分全部去掉即可 https://blog.csdn.net/qq_403 ...
- AssertionError: Torch not compiled with CUDA enabled到底是什么原因
代码运行报错AssertionError: Torch not compiled with CUDA enabled 但是根据cuda安装显示 cuda是安装成功的 这是怎么回事 我先进入百度翻译 A ...
- AssertionError: Torch not compiled with CUDA enabled解決方案
在執行pytorch代碼的時候,突然看到報錯 AssertionError: Torch not compiled with CUDA enabled 這說明了 1. 你pytoch确实安装了 2. ...
- 报错 AssertionError: Torch not compiled with CUDA enabled
报错: AssertionError: Torch not compiled with CUDA enabled 本文针对仅有CPU无GPU的设备,针对该报错进行修改: 在代码开头添加: // A c ...
最新文章
- 配置Tomcat使用https协议
- NYOJ 100 1的个数
- mysql特别点_Mysql 特别注意点!
- SpringBoot + MyBatis(注解版),常用的SQL方法
- spring学习(38):注入set类型
- h5与小程序服务器如何辨别,小程序丨教你六招,快速区分H5页面还是APP页面
- 探寻安全管理平台(SOC)项目的关键成功因素
- 辽宁计算机应用考试报名时间,2021辽宁上半年计算机应用水平考试报名时间及方法...
- 服务器物理内存只增不降,服务器内存不断增加
- js table多层嵌套_只会console.log?8个高效调试js的console方法
- 谈谈原子变量与锁的性能比较
- Linux命令解释之sudo
- python iotextwrapp执行不动_Python tkinter - 第10章 文本控件(Text)方法
- 华为手机一键解锁工具箱下载 | 华为手机解BL锁软件: 支持解锁bootloader,刷写recovery功能
- 视频直播技术详解之延迟优化
- 前端处理无网络兜底图片展示
- 【PHPWord】如何解决PHPWord的输出checkbox复选框并设置checked已勾选
- 夜曲歌词 拼音_矢野真纪《夜曲》罗马拼音歌词
- OpenVINO™基于人脸landmark检测实现眼睛疲劳/睡意检测
- 毕业设计 - 基于Java的聊天室系统设计与实现【源码+论文】