Jetson 下载中心 | NVIDIA Developer
下载好后先放置一个新的文件夹下
链接:https://pan.baidu.com/s/176NGGZZrtBWjHC-ibWrRdg 密码:1111
打开SDFormatter格式化软件,最好选择32g和64g的闪迪内存卡。
更新一下选择内存卡进行格式化。
选着刚才下载的jetsonnano2gb的镜像文件,再选择设备内存卡,后写入,等待烧录。烧录时间大概18分钟,烧录成功后点击完成直接弹出内存卡,不用理会系统弹出的内存卡错误。
先把刚才的内存卡插入jetsonnano的sd卡槽
后连接键盘鼠标,显示屏,电源,网线等外设
后上电等待系统初始化
系统初始化
选择语言可选择简体中文,后继续
选择键盘的语言按照默认选择
选择wifi但是我的jetsonnano2gb并没有wifi这个功能,此部分可先不连接直接跳过
选择地区,选上海就可以了,后继续
设置用户名和密码,用户名英文不要带中文。(建议密码用户名简单一些,不然忘记有点麻烦)
后继续登录账号
登录成功后
设置root密码
Ubuntu的 默认root密码是随机的,每次开机都有一个新的root密码。我们需要重新设置一个。
打开终端
输入sudo passwd更改密码这样jetsonano2gb的开机配置就完成啦!
因为jetson nano2gb没有wifi要插网线,用校园网的同学先进浏览器登录后再进行工作
打开终端输入sudo apt-get update(如果出现错误看下面的解决步骤,若没出现直接划到下面看另一种方法)
Err:84 http://us.archive.ubuntu.com/ubuntu bionic-backports/main arm64 Packages 404 Not Found [IP: 91.189.91.38 80]
解决步骤:
cat /etc/issue
cd /etc/apt
cp /etc/apt/sources.list /etc/apt/sources.list.bak
deb https://mirrors.ustc.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-security main restricted universe mult
或
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe
sudo apt-get update
终端输入命令打开sources.list文件
sudo gedit /etc/apt/sources.list
删除文件内所有内容,添加下述内容(以清华大学镜像源为例,注意镜像源需要支持arm64架构):
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-proposed main restricted universe multiverse
阿里巴巴镜像源:
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.aliyun.com/ubuntu-ports/ bionic main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu-ports/ bionic main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu-ports/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu-ports/s bionic-backports main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu-ports/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu-ports/ bionic-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu-ports/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu-ports/ bionic-proposed main restricted universe multiverse
系统源和软件源配置完成以后,使用下述两条命令更新:
sudo apt update
sudo apt upgrade -y
#安装pip3
sudo apt-get update
sudo apt-get install python3-pip python3-dev -y
#安装jtop(安装jtop,首先安装pip3)
#安装jtop库这个可以监控自己的设备cpu、gpu工状态
sudo -H pip3 install jetson-stats
sudo jtop #运行jtop(第一次可能不行,第二次就好了) 按【q】退出
这里我直接给出我的百度云链接,因为去官网下载至少30分钟,先用电脑下载到另一个u盘再插入英伟达板子.
https://pan.baidu.com/s/1W9LjQsmdM6RwSUH3x4wmJA提取码:1111
1.sudo ./Archiconda3-0.2.3-Linux-aarch64.sh 安装
2.sudo vim ~/.bashrc
3.最后一行添加export PATH=~/archiconda3/bin:$PATH
4.退出后刷新source ~/.bashrc
conda create -p XXXXX python=3.6
conda activate XXXXX激活虚拟环境,往后想进入虚拟环境就运行此行代码
离开虚拟环境命令conda env list
conda remove -p XXXXX --all 删除虚拟环境
虚拟环境可在archiconda文件的env里看到
Xxxx是你自己想创建的虚拟环境名称,为什么选3.6呢?因为jetson nano2gb搭建yolov5其已经自带python2.7和python3.6,直接用其只有的python创建即可。
Jetsonnano的镜像自带cuda10.2和cudnn加速库
1.gedit ~/.bashrc终端运行
2.底行输入
export PATH=/usr/local/cuda-10.2/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
export CUDA_HOME=/usr/local/cuda-10.2
export OPENBLAS_CORETYPE=ARMV8 # 不加的话,运行相关的项目会内核崩掉
3.保存退出
4.source ~/.bashrc刷新环境
nvcc -V检查cuda环境出现cuda10.2就是配置成功
其是安装yolov5里面两个最重要的包,要严格对应下载,要对照自己的cuda版本去依照安装
其pytorch下载方式可去官网PyTorch下载
历史版本在这个网站PyTorch for Jetson - version 1.10 now available - Jetson & Embedded Systems / Jetson Nano - NVIDIA Developer Forums
或者可以下载我的百度云链接进行下载
链接:https://pan.baidu.com/s/1OzqcBppG-69lAkc_BQbw7w
提取码:1111
接下来就是这两个包的安装,先用电脑下载好后传入nano进行安装
2.安装pip
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get install python3-pip libopenblas-base libopenmpi-dev
pip3 install --upgrade pip #如果pip已是最新,可不执行
再添加清华源为默认网址,终端输入
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
然后找到下载好的torch-1.8.0-cp36-cp36m-linux_aarch64.whl包的所在文件夹,进入文件夹中,输入安装命令:
pip3 install torch-1.8.0-cp36-cp36m-linux_aarch64.whl #注意安装包的位置不得的话就加sudo
测试pytorch是否安装成功:
python #进入python编码
import torch
print(torch.__version__)
看到torch的版本号,torch安装成功
进入trochvision文件夹中,
执行命令:
export BUILD_VERSION=0.9.0
然后执行安装命令:
python setup.py install //需要巨他妈久的安装时间1个半小时左右
4.测试trochvision是否安装成功
进入python编码:
python
执行:
import torchvision
再执行:
print(torchvision.__version__)
看到torchvision版本号,成功。安装到这里就差不多成功了,下面只要进入yolov5文件夹中去就大功告成。
pip install -r requirements.txt
因为我们前面更换了清华源镜像所以下载速度还是很快的,等待安装完成。
测试yolov5
python detect.py --weights yolov5s.pt
其gpu环境虽然只有8-10帧但是对于一块500块左右的板子性能还算不错了,不使用串口,加速后能够有25帧的效果。(摄像头的帧率对yolov5运行的帧率也很吃要求)