Debian9.8 安裝 pytorch (不安裝cuda):
apt install -y git python3-dev
git clone --recursive https://github.com/pytorch/pytorchpython
export NO_CUDA=1git
export USE_NUMPY=1github
export USE_FFMPEG=1redis
export USE_OPENCV=1ui
export USE_REDIS=1
cd pytorch3d
pip install opencv-python numpy scipy tensorflow scikit-learn matplotlib redis ffmpegblog
pip install pyyamlip
pip install -r requirements.txt
python3 setup.py installci
pip install torchvision開發
或者直接按照pytorch官網上https://pytorch.org/選擇你要安裝的,如:
pip install https://download.pytorch.org/whl/cpu/torch-1.0.1-cp35-cp35m-win_amd64.whl
用命令查看pytorch適合安裝成功:
pip list | grep torch
簡單例子:
import torch
x = torch.empty(5, 3)
print(x)
輸出:
哈哈,之後就能夠用pytorch開發了