pytorch安装

Posted shadowwalker9

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了pytorch安装相关的知识,希望对你有一定的参考价值。

环境:ubuntu16.04

(1) install python3

16.04 里面默认安装了python2.7 和3.5

sudo update-alternatives –install /usr/bin/python python /usr/bin/python2 100

sudo update-alternatives –install /usr/bin/python python /usr/bin/python3 150 

如果想要改回Python2 执行如下命令 
sudo update-alternatives –config python 
按照提示输入选择数字回车即可。 

(2) install pip3

sudo apt-get install python3-pip

如果报错"Unable to locate package python3-pip"

前面加一行:

sudo apt-get update

(3) install numpy, scipy, matplotlib

pip3 install numpy

pip3 install scipy

pip3 install matplotlib

(4) install pytorch

pip3 install http://download.pytorch.org/whl/cu75/torch-0.2.0.post3-cp35-cp35m-manylinux1_x86_64.whl 
pip3 install torchvision

RuntimeError: PyTorch does not currently provide packages for PyPI (see status at https://github.com/pytorch/pytorch/issues/566).
    
Please follow the instructions at http://pytorch.org/ to install with miniconda instead.

(5) anaconda pytorch

 

以上是关于pytorch安装的主要内容,如果未能解决你的问题,请参考以下文章

[pytorch]pytorch官方安装法

安装pytorch-gpu时会默认安装cpu版本

pytorch安装

GPU版本的pytorch安装(一次成功)

[pytorch学习]1.pytorch ubuntu安装

PyTorch官方支持windows了