在Jetson nano上搭建深度学习环境(Anoconda和pytorch安装)
1.Miniforge安装
1.安装bash文件
bash Miniforge-pypy3-4.9.0-3-Linux-aarch64.sh
完成后如图:
2.创建自己的环境,命名为nano
conda create -n nano python=3.6
2.pytorch安装
1.激活环境
2.依次执行以下几个命令,pytorch版本视自己情况而定
wget https://nvidia.box.com/shared/static/p57jwntv436lfrd78inwl7iml6p13fzh.whl -O torch-1.8.0-cp36-cp36m-linux_aarch64.whl
sudo apt-get install python3-pip libopenblas-base libopenmpi-dev
pip3 install Cython
pip3 install numpy torch-1.8.0-cp36-cp36m-linux_aarch64.whl
完成后检查一下
python3
import torch
如下图,无报错则安装正确,若出现core error则关闭terminal,重新打开即可
3.安装torchvision
注意替换为自己的torchvision版本
sudo apt-get install libjpeg-dev zlib1g-dev libpython3-dev libavcodec-dev libavformat-dev libswscale-dev
git clone --branch <version> https://github.com/pytorch/vision torchvision # see below for version of torchvision to download
cd torchvision
export BUILD_VERSION=0.x.0 # where 0.x.0 is the torchvision version
python3 setup.py install --user
cd ../ # attempting to load torchvision from build dir will result in #import error
pip install 'pillow<7' # always needed for Python 2.7, not needed torchvision v0.5.0+ with Python 3.6
import torchvision检查一下:
文中所有资源可在此处下载
完结撒花!!!