install pytorch on TX2(自己手打,总结)

#这里打算用python3.5来装
pip3 --version
pip3 9.0.1 from path/to/lib/python3.5/site-packages/pip (python 3.5)
sudo apt install libopenblas-dev libatlas-dev liblapack-dev
sudo apt install liblapacke-dev checkinstall # For OpenCV
sudo apt-get install python3-pip

pip3 install --upgrade pip3==9.0.1
sudo apt-get install python3-dev

sudo pip3 install numpy scipy # 这个花费的时间略长,20分钟到30分钟左右
sudo pip3 install pyyaml
sudo pip3 install scikit-build
sudo apt-get -y install cmake
sudo apt install libffi-dev
sudo pip3 install cffi

 

sudo gedit ~/.bashrc
export CUDNN_LIB_DIR=/usr/lib/aarch64-linux-gnu
export CUDNN_INCLUDE_DIR=/usr/include
source ~/.bashrc

 

sudo nvpmodel -m 0         # 切换工作模式到最大
sudo  ~/jetson_clocks.sh   # 强制开启风扇最大转速 

 

wget https://rpmfind.net/linux/mageia/distrib/cauldron/aarch64/media/core/release/ninja-1.8.2-3.mga7.aarch64.rpm

sudo add-apt-repository universe

sudo apt-get update

sudo apt-get install alien

sudo apt-get install nano

sudo alien ninja-1.8.2-3.mga7.aarch64.rpm

#If previous line fails, proceed to <$sudo dpkg -i ninja-1.8.2-3.mga7.aarch64.deb>

      sudo alien -g ninja-1.8.2-3.mga7.aarch64.rpm

      cd ninja-1.8.2

      sudo nano debian/control

      #at architecture, add arm64 after aarch64         aarch64 to        aarch64, arm64   

      sudo debian/rules binary

      cd ..

sudo dpkg -i ninja_1.8.2-4_arm64.deb

sudo apt install ninja-build

 

 

 

#首先下载,因为最新的版本貌似编译有点问题,所以下载旧的版本吧,这行命令也是好久才找到的,听说还可以下0.4.1版本

git clone --recursive --depth 1 https://github.com/pytorch/pytorch.git -b v${PYTORCH_VERSION=0.5.
 

 

#进入文件夹

cd pytorch
 

#升级一下

git submodule update --init
 

#安装依赖库

sudo pip3 install -U setuptools
sudo pip3 install -r requirements.txt
 

进行安装

sudo python3 setup.py install

#这里直接后面用install,网上有人用,develop,build的命令,实验了一周都不对
 

#再安装另外一个依赖库

pip3 install tensorboardX

 

#下载另一个文件夹

git clone https://github.com/pytorch/vision

cd vision

#安装

sudo python3 setup.py install

install pytorch on TX2(自己手打,总结)_第1张图片

你可能感兴趣的:(install pytorch on TX2(自己手打,总结))