和Drive PX2的编译没有什么区别
源码编译步骤
注意:当完全按照以下步骤进行编译时,如果出现错误,注意检查CUDA版本、对应的库是否存在
# Download PyTorch sources
git clone --recursive --branch <version> http://github.com/pytorch/pytorch
cd pytorch
# Set Build Options
export USE_NCCL=0
export USE_DISTRIBUTED=0
export TORCH_CUDA_ARCH_LIST="5.3;6.2;7.2"
export PYTORCH_BUILD_VERSION=<version> # without the leading 'v', e.g. 1.1.0 for PyTorch v1.1.0
export PYTORCH_BUILD_NUMBER=1
# Build wheel for Python 2.7 (to pytorch/dist)
sudo apt-get install python-pip cmake
pip install -U pip
sudo pip install -U setuptools
sudo pip install -r requirements.txt
pip install scikit-build --user
pip install ninja --user
# 或者使用 python setup.py build直接安装
python setup.py bdist_wheel
# Build wheel for Python 3.6 (to pytorch/dist)
sudo apt-get install python3-pip cmake
sudo pip3 install -U setuptools
sudo pip3 install -r requirements.txt
pip3 install scikit-build --user
pip3 install ninja --user
# 或者使用 python setup.py build直接安装
python3 setup.py bdist_wheel