什么是PyTorch?
PyTorch是基于Python的科学计算包,主要有两个功能:
- 代替numpy去使用GPU计算
- 深度学习平台
Pytorch官网
PyTorch支持Linux,OSX和Windows系统
2018年4月26日更新 v0.4.0
Linux Python 2.7 CPU版 pip安装
pip install http://download.pytorch.org/whl/cpu/torch-0.4.0-cp27-cp27mu-linux_x86_64.whl
pip install torchvision
# if the above command does not work, then you have python 2.7 UCS2, use this command
pip install http://download.pytorch.org/whl/cpu/torch-0.4.0-cp27-cp27m-linux_x86_64.whl
Linux Python 2.7 GPU版 CUDA9.0 pip安装
pip install http://download.pytorch.org/whl/cu90/torch-0.4.0-cp27-cp27mu-linux_x86_64.whl
pip install torchvision
# if the above command does not work, then you have python 2.7 UCS2, use this command
pip install http://download.pytorch.org/whl/cu90/torch-0.4.0-cp27-cp27m-linux_x86_64.whl
Windows Python 3.6 CPU版 pip安装
pip3 install http://download.pytorch.org/whl/cpu/torch-0.4.0-cp36-cp36m-win_amd64.whl
pip3 install torchvision
Windows Python 3.6 GPU版 CUDA9.0 pip安装
pip3 install http://download.pytorch.org/whl/cu90/torch-0.4.0-cp36-cp36m-win_amd64.whl
pip3 install torchvision