由于jetson nano 是aarch64架构,Anaconda官方不支持aarch64架构,所以有了一个叫“Archiconda”,其目的就是将conda移植到aarch64平台上
一. 下载地址Releases · Archiconda/build-tools · GitHub
然后安装archiconda
bash Archiconda3-0.2.3-Linux-aarch64.sh
二.配置Python环境
由于ultralytics,需要在python>=3.8运行,而官方自带的python3为python3.6,需要我们安装python3.8。为了保证后期的开发方便,我创建了单独环境,命令如下
1.安装依赖
cd ~
sudo apt update
sudo apt upgrade
sudo apt install build-essential libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev libffi-dev libc6-dev
2.创建环境pytthon3.8的环境
conda create -n yolov8 python=3.8
conda activate yolov8
三、安装torch环境
我们无法通过 pip 安装PyTorch 和 Torchvision,因为它们与基于ARM aarch64 架构的 Jetson 平台不兼容。因此,我们需要手动安装预编译的PyTorch pip wheel,并从源代码编译/安装 Torchvision
1.百度网盘链接如下
torch
链接:https://pan.baidu.com/s/1XJJVq7wxJqwrmBDEOQE_mA
提取码:g7aa
torchvision
链接:https://pan.baidu.com/s/1xi_79MU_Mg2zDK6T2FxxRA
提取码:dp5u
2.安装torch torchvision
安装过程中,出现如下错如:
nvidia nano import torch时报OSError: libmpi_cxx.so.20: cannot open shared object file: No such file or... 请安装
sudo apt-get install libopenblas-base libopenmpi-dev
OSError: libcurand.so.10: cannot open shared object file: No such file or director 安装
sudo apt-get update
sudo apt-get install cuda-toolkit-10-2
OSError: libomp.so.5: cannot open shared object file: No such file or directory 安装
sudo apt-get update
sudo apt-get install libomp-dev
sudo apt-get install libomp5
四、安装ultralytics
conda activate yolov5
pip install ultralytics
安装完成,我们可以通过以下命令查看YOLOv8的版本信息
pip showu ultralytics
至此,我们已经完成Yolov8在Jetson nano上的部署