PyTorch的下载命令

目前PyTorch的官网版本为1.1,最低支持CUDA的版本为9.0(这对于很多项目而言太新了),以下是官网中对于下载的介绍:

START LOCALLY

Select your preferences and run the install command. Stable represents the most currently tested and supported version of PyTorch 1.1. This should be suitable for many users. Preview is available if you want the latest, not fully tested and supported, 1.1 builds that are generated nightly. Please ensure that you have met the prerequisites below (e.g., numpy), depending on your package manager. Anaconda is our recommended package manager since it installs all dependencies. You can also install previous versions of PyTorch. Note that LibTorch is only available for C++.

翻译

开始下载:

选择首选项并运行install命令。 Stable代表PyTorch 1.1最多测试和支持的版本。 这应该适合绝大多数用户。 如果您想要使用最新的版本——未经过完全测试和支持的1.1版本,则可以使用预览版本。 请确保您已满足以下先决条件(例如,numpy),具体取决于您的包管理器。 Anaconda是我们推荐的软件包管理器,因为它安装了所有依赖项。 您还可以安装以前版本的PyTorch。 请注意,LibTorch仅适用于C ++。

(早期PyTorch连接):

https://pytorch.org/get-started/previous-versions/

接下来是下载命令:

conda的:

conda install pytorch torchvision cudatoolkit=9.0 -c pytorch       #cuda9.0
conda install pytorch torchvision cudatoolkit=10.0 -c pytorch      #cuda10.0
conda install pytorch-cpu torchvision-cpu -c pytorch               #cpu版本

pip的:(pip目前的标准是使用CUDA9.0,以python3.6为例)

######################CUDA9.0
pip3 install torch torchvision
######################CUDA10.0
pip3 install https://download.pytorch.org/whl/cu100/torch-1.1.0-cp36-cp36m-linux_x86_64.whl
pip3 install https://download.pytorch.org/whl/cu100/torchvision-0.3.0-cp36-cp36m-linux_x86_64.whl

######################CPU版本
pip3 install https://download.pytorch.org/whl/cpu/torch-1.1.0-cp36-cp36m-linux_x86_64.whl
pip3 install https://download.pytorch.org/whl/cpu/torchvision-0.3.0-cp36-cp36m-linux_x86_64.whl

源码直接下载:(GitHub中)

# Follow instructions at this URL: https://github.com/pytorch/pytorch#from-source
##意思是直接打开这个URL连接进行相关的版本选择下载##
##安装操作跟着教程走就可以##

 

分类: AIPyTorch

0 条评论

发表回复

Avatar placeholder

您的电子邮箱地址不会被公开。 必填项已用 * 标注