当前位置:网站首页>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/

下载需要的版本并安装,然后,问题就这样解决了!
边栏推荐
- 架构实战训练营|课后作业|模块 6
- Run the command once per second in Bash- Run command every second in Bash?
- Digital chemical plant management system based on Virtual Simulation Technology
- 九章云极DataCanvas公司蝉联中国机器学习平台市场TOP 3
- Unit test asp Net MVC 4 Application - unit testing asp Net MVC 4 apps thoroughly
- Lecture 3 of "prime mover x cloud native positive sounding, cost reduction and efficiency enhancement lecture" - kubernetes cluster utilization improvement practice
- 【线段树实战】最近的请求次数 + 区域和检索 - 数组可修改+我的日程安排表Ⅰ/Ⅲ
- Station B boss used my world to create convolutional neural network, Lecun forwarding! Burst the liver for 6 months, playing more than one million
- Two divs are on the same line, and the two divs do not wrap "recommended collection"
- Detect when a tab bar item is pressed
猜你喜欢

DFS and BFS concepts and practices +acwing 842 arranged numbers (DFS) +acwing 844 Maze walking (BFS)

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

用CPU方案打破内存墙?学PayPal堆傲腾扩容量,漏查欺诈交易量可降至1/30

九章云极DataCanvas公司获评36氪「最受投资人关注的硬核科技企业」

How to solve the problem of adding RTSP device to easycvr cluster version and prompting server ID error?

【线段树实战】最近的请求次数 + 区域和检索 - 数组可修改+我的日程安排表Ⅰ/Ⅲ

System framework of PureMVC

各路行业大佬称赞的跨架构开发“神器”,你get同款了吗?

Win11玩绝地求生(PUBG)崩溃怎么办?Win11玩绝地求生崩溃解决方法

The request request is encapsulated in uni app, which is easy to understand
随机推荐
Win11图片打不开怎么办?Win11无法打开图片的修复方法
树与图的深度优先遍历模版原理
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?
Acl2022 | decomposed meta learning small sample named entity recognition
JS form get form & get form elements
关于01背包个人的一些理解
每人每年最高500万经费!选人不选项目,专注基础科研,科学家主导腾讯出资的「新基石」启动申报
赠票速抢|行业大咖纵论软件的质量与效能 QECon大会来啦
【线段树实战】最近的请求次数 + 区域和检索 - 数组可修改+我的日程安排表Ⅰ/Ⅲ
Thesis landing strategy | how to get started quickly in academic thesis writing
leetcode 53. Maximum Subarray 最大子数组和(中等)
Win11控制面板快捷键 Win11打开控制面板的多种方法
Read of shell internal value command
Depth first traversal template principle of tree and graph
DFS和BFS概念及实践+acwing 842 排列数字(dfs) +acwing 844. 走迷宫(bfs)
R语言主成分pca、因子分析、聚类对地区经济研究分析重庆市经济指标
What if the win11 screenshot key cannot be used? Solution to the failure of win11 screenshot key
Field data acquisition and edge calculation scheme of CNC machine tools
What about the collapse of win11 playing pubg? Solution to win11 Jedi survival crash
九章云极DataCanvas公司摘获「第五届数字金融创新大赛」最高荣誉!