我的新板子到了,型号是jetson orin Nano与之前的jetson nano稍有不同我发现库又得从新下载
我的pip3的版本是3.8.10,jetpack版本5.1.1,又得重新开始下载库😭
安装pytorch:
得科学上网:
PyTorch for Jetson - Jetson Nano - NVIDIA Developer Forums
根据自己的系统选择:
Python 3.8 - torch-2.0.0+nv23.05-cp38-cp38-linux_aarch64.whl 296
PyTorch v2.0.0 - torchvision v0.15.1
将上述两个文件下载到jetson中
安装支持包:
sudo apt-get -y update;
sudo apt-get -y install autoconf bc build-essential g++-8 gcc-8 clang-8 lld-8 gettext-base gfortran-8 iputils-ping libbz2-dev libc++-dev libcgal-dev libffi-dev libfreetype6-dev libhdf5-dev libjpeg-dev liblzma-dev libncurses5-dev libncursesw5-dev libpng-dev libreadline-dev libssl-dev libsqlite3-dev libxml2-dev libxslt-dev locales moreutils openssl python-openssl rsync scons python3-pip libopenblas-dev;
配置环境变量:
#注意,我们安装的JetPack 5.1.1,所以找对版本对应
export TORCH_INSTALL=https://developer.download.nvidia.cn/compute/redist/jp/v511/pytorch/torch-2.0.0+nv23.05-cp38-cp38-linux_aarch64.whl
#`JP_VERSION`
#The major and minor version of JetPack you are using, such as `461` for JetPack 4.6.1 or `50` for JetPack 5.0.
安装:
python3 -m pip install --upgrade pip; python3 -m pip install aiohttp numpy=='1.19.4' scipy=='1.5.3' export "LD_LIBRARY_PATH=/usr/lib/llvm-8/lib:$LD_LIBRARY_PATH"; python3 -m pip install --upgrade protobuf; python3 -m pip install --no-cache $TORCH_INSTALL
torchvision 0.15.1安装:
建议是先科学上网下载后再传到jetson中
$ sudo apt-get install libjpeg-dev zlib1g-dev libpython3-dev libopenblas-dev libavcodec-dev libavformat-dev libswscale-dev
#这个官方教程没写
$ pip3 install setuptools
#$ sudo pip3 install --upgrade pillowwget https://github.com/pytorch/vision/archive/refs/tags/v0.15.1.zip
#$ git clone --branch v0.15.1 https://github.com/pytorch/vision torchvision
#克隆源代码
git clone --branch v0.15.1 https://github.com/pytorch/vision torchvision
cd torchvision/
git checkout -b v0.15.1
#查看当前分支
git branch -a
#如果一直无法拉过来,可以选择使用迅雷下载包后拷贝到开发套件中
$ unzip v0.15.1.zip
$ cd vision-0.15.1
$ export BUILD_VERSION=0.15.1
$ python3 setup.py install --user
学习于:
Jeston Orin Nnao 安装pytorch与torchvision环境