Nodjoy

只做了一点微小的工作


  • 首页

  • 技术

  • 笔记

  • 杂记

  • 分享

  • 归档

  • 关于

  • 站点监控

  • 服务监控

  • 搜索

  • GitHub

  • Email

  • Bilibili

  • 语雀

  • 抖音

  • 打赏

  • 在线笔记

  • wiki

  • 在线文档

  • 域名证书管理

  • Download Hub

  • DockerHub Mirror

  • Clash Dashboard

  • 我的小店

  • Quick Reference

  • Linux 命令查询

  • Mock 模拟数据
友链
  • 小菜
close

Jetson设备配置yolo环境

时间: 2026-05-12   |   分类: 笔记     |   阅读: 285 字 ~ 1分钟   |   阅读量:

环境

  • Jetpack 6.2.2
  • Ubuntu 22.04

Install some dependences and pip

sudo apt install python3-pip libopenblas-base libopenmpi-dev libomp-dev libjpeg-dev zlib1g-dev libpython3-dev libopenblas-dev libavcodec-dev libavformat-dev libswscale-dev

pip config --user set global.index-url https://mirrors.huaweicloud.com/repository/pypi/simple
pip install --upgrade pip

Install pytorch torchvision

# https://developer.download.nvidia.com/compute/redist/jp/v61/pytorch/

wget https://developer.download.nvidia.com/compute/redist/jp/v61/pytorch/torch-2.5.0a0+872d972e41.nv24.08.17622132-cp310-cp310-linux_aarch64.whl

pip install torch-2.5.0a0+872d972e41.nv24.08.17622132-cp310-cp310-linux_aarch64.whl

git clone --branch release/0.20 https://github.com/pytorch/vision torchvision

cd torchvision
export BUILD_VERSION=0.20
python3 setup.py install --user # 会报错,需要安装cusparselt:https://developer.nvidia.com/cusparselt-downloads

# install cusparselt
wget https://developer.download.nvidia.com/compute/cusparselt/0.9.1/local_installers/cusparselt-local-repo-ubuntu2204-0.9.1_0.9.1-1_arm64.deb
sudo dpkg -i cusparselt-local-repo-ubuntu2204-0.9.1_0.9.1-1_arm64.deb
sudo cp /var/cusparselt-local-repo-ubuntu2204-0.9.1/cusparselt-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cusparselt

# 再次尝试安装
python3 setup.py install --user

Check CUDA and cuDNN

import torch
print('CUDA available: ' + str(torch.cuda.is_available()))
print('cuDNN version: ' + str(torch.backends.cudnn.version()))
a = torch.tensor([0., 0.], dtype=torch.float32, device='cuda')
print('Tensor a =', a)
b = torch.randn(2, device='cuda')
print('Tensor b =', b)
c = a + b
print('Tensor c =', c)

import torchvision
print(torchvision.__version__)

Install numpy 1.26.4

pip uninstall numpy
pip install numpy==1.26.4

Install ultralytics

pip install ultralytics

Export engine model file

yolo export model=best.pt format=engine device=0 half=True imgsz=640 simplify=False workspace=4

Install jtop

sudo pip install jetson-stats
sudo systemctl enable jtop.service
sudo systemctl start jtop.service

Install gstreamer and opencv

sudo apt install -y \
  python3-gi \
  python3-gst-1.0 \
  gstreamer1.0-tools \
  gstreamer1.0-plugins-base \
  gstreamer1.0-plugins-good \
  gstreamer1.0-plugins-bad \
  gstreamer1.0-plugins-ugly \
  libgstreamer1.0-dev \
  libgstreamer-plugins-base1.0-dev \
  gstreamer1.0-plugins-base-apps

pip uninstall opencv-python opencv-contrib-python opencv-python-headless

sudo apt install -y python3-opencv

  标题:Jetson设备配置yolo环境
  作者:Nodjoy
  声明:自由转载-非商用-非衍生-保持署名


给 nodjoy.com 打赏......

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作。

打赏支持

#jetson# #python# #pytorch# #yolo# #ubuntu#
OCR识别图片文字内容
  • 文章目录
  • 站点概览
Nodjoy

Nodjoy

Developer & Acceleration Engineer⏩

GitHub Email Bilibili 语雀 抖音 打赏
55 日志
4 分类
70 标签
工具站
  • 在线笔记
  • wiki
  • 在线文档
  • 域名证书管理
  • Download Hub
  • DockerHub Mirror
  • Clash Dashboard
  • 我的小店
  • Quick Reference
  • Linux 命令查询
  • Mock 模拟数据
友情链接
  • 小菜
  • 环境
  • Install some dependences and pip
  • Install pytorch torchvision
  • Check CUDA and cuDNN
  • Install numpy 1.26.4
  • Install ultralytics
  • Export engine model file
  • Install jtop
  • Install gstreamer and opencv
京ICP备17004223号 © 2020 - NODJOY.
Powered by - HUGO
Theme by - NexT
访客量 -
0%