当前位置: 首页 > news >正文

Linux 35.6 + JetPack v5.1.4之 pytorch升级

Linux 35.6 + JetPack v5.1.4之 pytorch升级

  • 1. 源由
  • 2. 升级
    • 步骤1:获取二进制版本
    • 步骤2:安装二进制版本
    • 步骤3:获取torchvision
    • 步骤4:安装torchvision
    • 步骤5:检查安装版本
  • 3. 使用
  • 4. 补充
    • 4.1 torchvision版本问题
    • 4.2 支持pytorch版本
    • 4.3 opencv-python>=4.6.0问题

1. 源由

鉴于之前NVIDIA提供基于JetPack v5.1.4二进制pytorch版本最高为 v2.1.0

经过不断地各方努力,《Linux 35.6 + JetPack v5.1.4之编译 pytorch》,我们已经有了python3.8.0的 pytorch v2.4.1.

2. 升级

步骤1:获取二进制版本

$ wget https://github.com/SnapDragonfly/pytorch/releases/download/v2.3.1%2Bl4t35.6-cp38-cp38-aarch64/torch-2.3.1+l4t35.6-cp38-cp38-linux_aarch64.whl

步骤2:安装二进制版本

$ sudo pip3 install torch-2.3.1+l4t35.6-cp38-cp38-linux_aarch64.whl

步骤3:获取torchvision

$ git clone https://github.com/SnapDragonfly/vision.git torchvision
$ cd torchvision
$ git checkout nvidia_v0.19.1

步骤4:安装torchvision

$ export BUILD_VERSION=0.19.1
$ sudo python3 setup.py install --user
$ cd ..

步骤5:检查安装版本

$ git clone https://github.com/SnapDragonfly/jetson-fpv.git
$ cd jetson-fpv
$ sudo ./wrapper.sh version
[sudo] password for daniel:
Skipping CMD_KEYMONITOR execution for module 'version'.
Executing command on module version:Software part of jetson-stats 4.2.12 - (c) 2024, Raffaello Bonghi
Model: NVIDIA Orin Nano Developer Kit - Jetpack 5.1.4 [L4T 35.6.0]
NV Power Mode[0]: 15W
Serial Number: [XXX Show with: jetson_release -s XXX]
Hardware:- P-Number: p3767-0005- Module: NVIDIA Jetson Orin Nano (Developer kit)
Platform:- Distribution: Ubuntu 20.04 focal- Release: 5.10.216-tegra
jtop:- Version: 4.2.12- Service: Active
Libraries:- CUDA: 11.4.315- cuDNN: 8.6.0.166- TensorRT: 8.5.2.2- VPI: 2.4.8- OpenCV: 4.9.0 - with CUDA: YES
DeepStream C/C++ SDK version: 6.3Python Environment:
Python 3.8.10GStreamer:                   YES (1.16.3)NVIDIA CUDA:                   YES (ver 11.4, CUFFT CUBLAS FAST_MATH)OpenCV version: 4.9.0  CUDA TrueYOLO version: 8.3.33Torch version: 2.4.1+l4t35.6Torchvision version: 0.19.1a0+6194369
DeepStream SDK version: 1.1.8

3. 使用

略,参考《Ardupilot开源无人机之Geek SDK讨论》

  • SnapDragonfly/jetson-fpv

在这里插入图片描述

$ cd jetson-fpv
$ sudo ./wrapper.sh dsyolo start

4. 补充

4.1 torchvision版本问题

若仍然使用之前NVIDIA安装 v2.1.0 版本对应的 torchvision v0.16.1 或者 0.16.2 则会出现以下报错!

$ sudo ./wrapper.sh version
Skipping CMD_KEYMONITOR execution for module 'version'.
Executing command on module version:Software part of jetson-stats 4.2.12 - (c) 2024, Raffaello Bonghi
Model: NVIDIA Orin Nano Developer Kit - Jetpack 5.1.4 [L4T 35.6.0]
NV Power Mode[0]: 15W
Serial Number: [XXX Show with: jetson_release -s XXX]
Hardware:- P-Number: p3767-0005- Module: NVIDIA Jetson Orin Nano (Developer kit)
Platform:- Distribution: Ubuntu 20.04 focal- Release: 5.10.216-tegra
jtop:- Version: 4.2.12- Service: Active
Libraries:- CUDA: 11.4.315- cuDNN: 8.6.0.166- TensorRT: 8.5.2.2- VPI: 2.4.8- Vulkan: 1.3.204- OpenCV: 4.9.0 - with CUDA: YES
DeepStream C/C++ SDK version: 6.3Python Environment:
Python 3.8.10GStreamer:                   YES (1.16.3)NVIDIA CUDA:                   YES (ver 11.4, CUFFT CUBLAS FAST_MATH)OpenCV version: 4.9.0  CUDA TrueYOLO version: WARNING ⚠️ torchvision==0.16 is incompatible with torch==2.4.
Run 'pip install torchvision==0.19' to fix torchvision or 'pip install -U torch torchvision' to update both.
For a full compatibility table see https://github.com/pytorch/vision#installation
8.3.33Torch version: 2.4.1+l4t35.6Torchvision version: 0.16.1+fdea156
DeepStream SDK version: 1.1.8

4.2 支持pytorch版本

目前,支持4个pytorch版本:

  • Release pytorch-v2.4.1+l4t35.6-cp38-cp38-aarch64
  • Release pytorch-v2.3.1+l4t35.6-cp38-cp38-aarch64
  • Release pytorch_v2.2.2+l4t35.6-cp38-cp38-aarch64
  • Release pytorch_v2.1.2+l4t35.6-cp38-cp38-aarch64

4.3 opencv-python>=4.6.0问题

实际笔者环境是OpenCV4.9.0,但是还是报错;而使用python代码没有问题。

$ sudo pip3 install torch-2.4.1+l4t35.6-cp38-cp38-linux_aarch64.whl
[sudo] password for daniel:
Processing ./torch-2.4.1+l4t35.6-cp38-cp38-linux_aarch64.whl
Requirement already satisfied: jinja2 in /usr/lib/python3/dist-packages (from torch==2.4.1+l4t35.6) (2.10.1)
Requirement already satisfied: sympy in /usr/local/lib/python3.8/dist-packages (from torch==2.4.1+l4t35.6) (1.13.3)
Requirement already satisfied: fsspec in /usr/local/lib/python3.8/dist-packages (from torch==2.4.1+l4t35.6) (2024.10.0)
Requirement already satisfied: networkx in /usr/local/lib/python3.8/dist-packages (from torch==2.4.1+l4t35.6) (3.1)
Requirement already satisfied: typing-extensions>=4.8.0 in /usr/local/lib/python3.8/dist-packages (from torch==2.4.1+l4t35.6) (4.12.2)
Requirement already satisfied: filelock in /usr/lib/python3/dist-packages (from torch==2.4.1+l4t35.6) (3.0.12)
Requirement already satisfied: mpmath<1.4,>=1.1.0 in /usr/local/lib/python3.8/dist-packages (from sympy->torch==2.4.1+l4t35.6) (1.3.0)
ERROR: ultralytics 8.3.33 requires opencv-python>=4.6.0, which is not installed.
Installing collected packages: torchAttempting uninstall: torchFound existing installation: torch 2.1.0a0+41361538.nv23.6Uninstalling torch-2.1.0a0+41361538.nv23.6:Successfully uninstalled torch-2.1.0a0+41361538.nv23.6
Successfully installed torch-2.4.1+l4t35.6

http://www.mrgr.cn/news/82756.html

相关文章:

  • 三维管线管网自动化建模工具MagicPipe3D V3.6.0
  • 深入浅出Node.js-1(node.js入门)
  • 代码随想录算法训练营第十四天 | 226.翻转二叉树、101. 对称二叉树、104.二叉树的最大深度、111.二叉树的最小深度
  • ansible-api分析(VariableManager变量)
  • Linux :用户权限详解
  • 无线配置实验
  • 【LC】2469. 温度转换
  • Haskell语言的面向对象编程
  • 【python如何使用随机模块】
  • 智能工厂的设计软件 应用场景的一个例子: 为AI聊天工具添加一个知识系统 之23 “单子”职业能力原型:PIN语言/AI操作系统/robot扮演的actor
  • DX12 快速教程(3) —— 画矩形
  • easyx空洞武士项目总结
  • 基于springboot+vue的餐饮连锁店管理系统的设计与实现
  • 3272 小蓝的漆房
  • 【设计模式-2】23 种设计模式的分类和功能
  • 代码随想录算法训练营day23
  • 安装Linux
  • Oracle Dataguard(主库为单节点)配置详解(3):配置备库
  • 力扣【SQL连续问题】
  • App窗口创建流程(Android12 )
  • (已开源-AAAI25) RCTrans:雷达相机融合3D目标检测模型
  • 【设计模式-1】软件设计模式概述
  • 【Python】绿色便携版Python制作(发布)方法
  • Oracle Dataguard(主库为单节点)配置详解(2):配置主库
  • 智能工厂的设计软件 应用场景的一个例子: 为AI聊天工具添加一个知识系统 之21 再次重建 之6 整“拼” 项目文档+程序框架 总述
  • 【Linux】函数