标签:linu 网上 dia 版本 bre ml2 evel ash div
2020年8月25日:这个时间点,在Jetson TX2安装pytorch是一件非常简单的事情,网上很多文章把它写复杂了,实在是不应该呀
刷入JetPack 4.3,apt更换为国内源。选择这个版本的原因是对应cuda的版本为10.0。
JetPack 4.4对应cuda版本为10.2,如果需要cuda 10.2版本,请刷入4.4。
本文基于JetPack4.3,安装pytorch版本为1.2,torchvision版本为0.4.0
https://github.com/pyenv/pyenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo ‘export PYENV_ROOT="$HOME/.pyenv"‘ >> ~/.bashrc
echo ‘export PATH="$PYENV_ROOT/bin:$PATH"‘ >> ~/.bashrc
echo -e ‘if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi‘ >> ~/.bashrc
exec "$SHELL"
sudo apt update; sudo apt install --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
pyenv install 3.6.12
cd ~
pyenv local 3.6.12
https://forums.developer.nvidia.com/t/pytorch-for-jetson-nano-version-1-6-0-now-available/72048
下载PyTorch v1.2.0,JetPack为4.3
pip install torch-1.2.0a0+8554416-cp36-cp36m-linux_aarch64.whl
首先安装libjpeg-dev zlib1g-dev
sudo apt install libjpeg-dev zlib1g-dev
然后安装pillow,注意顺序
pip install ‘pillow<7‘
最后安装torchvision,版本一定要是0.4.0
git clone --branch v0.4.0 https://github.com/pytorch/vision torchvision
cd torchvision
export BUILD_VERSION=0.4.0
sudo python setup.py install
大功告成,多版本python共存,pytorch不会影响到系统自带的python
Ubuntu18.04-多个Python版本共存-pyenv-Jetson TX2-JetPack 4.3-pytorch安装-torchvision
标签:linu 网上 dia 版本 bre ml2 evel ash div
原文地址:https://www.cnblogs.com/zhouww/p/13561598.html