当前位置:网站首页>AttributeError: module ‘torch._C‘ has no attribute ‘_cuda_setDevice‘
AttributeError: module ‘torch._C‘ has no attribute ‘_cuda_setDevice‘
2022-07-06 22:15:00 【牧羊女说】
在Jetson上跑一个PyTorch推理程序,安装完基础环境之后,根据CUDA版本安装PyTorch。
CUDA版本为11.4:

然后通过PyTorch官网获取安装命令行:

安装成功后,运行推理程序时出现题目中的Error:

测试CUDA,发现不可用:

最开始怀疑PyTorch的CUDA版本问题,于是升级到11.6,该问题依然存在。
后来的定位经过:
(1) JetPack与PyTorch的兼容性问题,参考链接PyTorch for Jetson - version 1.11 now available - Jetson Nano - NVIDIA Developer Forums
尝试下载了如下文件,但安装时提示与Platform不匹配。
torch-1.12.0a0+2c916ef.nv22.3-cp38-cp38-linux_aarch64.whl
(2) Python版本问题:各项资料均提到目前Jetson上只能支持Python3.6,而我们装的是Python3.8。不过该步未验证,后来定位到了第(3)种原因后问题直接解决了。
(3) 终极方案
最后查找到该网页:PyTorch for Jetson Platform
该网页给出了JetPack版本和PyTorch版本的对应关系:

我们的JetPack使用的是5.0.1,按照上面表格,应该使用1.13的PyTorch版本,而我们之前一直安装的都是1.12。
通过该链接找到了适用于Jetson的PyTorch1.13版本下载地址:https://developer.download.nvidia.cn/compute/redist/jp/v50/pytorch/

下载需要的版本并安装,然后,问题就这样解决了!
边栏推荐
- SQL where multiple field filtering
- 深入解析Kubebuilder
- Detect when a tab bar item is pressed
- Introduction to the PureMVC series
- kivy教程之设置窗体大小和背景(教程含源码)
- [team learning] [34 issues] scratch (Level 2)
- Terms used in the Web3 community
- MySQL null value processing and value replacement
- The root file system of buildreoot prompts "depmod:applt not found"
- Win11图片打不开怎么办?Win11无法打开图片的修复方法
猜你喜欢

Easycvr cannot be played using webrtc. How to solve it?
![[practice leads to truth] is the introduction of import and require really the same as what is said on the Internet](/img/58/4337f0972f7171a5c21e640f03e0b7.png)
[practice leads to truth] is the introduction of import and require really the same as what is said on the Internet

这项15年前的「超前」技术设计,让CPU在AI推理中大放光彩

Fix the problem that the highlight effect of the main menu disappears when the easycvr Video Square is clicked and played

Vscode 如何使用内置浏览器?

Intel David tuhy: the reason for the success of Intel aoten Technology

System framework of PureMVC

Analyse approfondie de kubebuilder

窗口可不是什么便宜的东西

R语言主成分pca、因子分析、聚类对地区经济研究分析重庆市经济指标
随机推荐
Easycvr cannot be played using webrtc. How to solve it?
Tiktok may launch an independent grass planting community platform: will it become the second little red book
MySQL null value processing and value replacement
过气光刻机也不能卖给中国!美国无理施压荷兰ASML,国产芯片再遭打压
Structure actual training camp | after class homework | module 6
How to package the parsed Excel data into objects and write this object set into the database?
论文上岸攻略 | 如何快速入门学术论文写作
Acl2022 | decomposed meta learning small sample named entity recognition
浙江大学周亚金:“又破又立”的顶尖安全学者,好奇心驱动的行动派
Can I specify a path in an attribute to map a property in my class to a child property in my JSON?
[team learning] [34 sessions] Alibaba cloud Tianchi online programming training camp
组织实战攻防演练的5个阶段
窗口可不是什么便宜的东西
What if win11 pictures cannot be opened? Repair method of win11 unable to open pictures
深耕开发者生态,加速AI产业创新发展 英特尔携众多合作伙伴共聚
【实践出真理】import和require的引入方式真的和网上说的一样吗
Is there any way to bookmark the code in the visual studio project- Is there a way to bookmark code in a Visual Studio project?
Meaning of 'n:m' and '1:n' in database design
九章云极DataCanvas公司摘获「第五届数字金融创新大赛」最高荣誉!
jvm是什么?jvm调优有哪些目的?