如何安装pytorch

pytorch的安装,打开官网即有相应说明,但是,根据官网的方式,安装特别慢,因此可以下载whl文件,pip install安装。whl文件的网址:打开pytorch官网就,找到previous pytroch versions
在这里插入图片描述
然后可以找到via pip
在这里插入图片描述
假如我要安装cuda9.2的版本,可以点击倒数第二个链接,进入如下界面:
在这里插入图片描述
可以看到,这里有适用cuda92的不同pytorch版本,不同python版本,不同系统的whl文件。

  • 实例:
# linux python36 cuda92  pytorch1.3.1
wget https://download.pytorch.org/whl/cu92/torch_stable.html/torch-1.3.1%2Bcu92-cp36-cp36m-linux_x86_64.whl
pip install 下载好的whl文件名
pip install torchvision

猜你喜欢

转载自blog.csdn.net/weixin_43178406/article/details/105486220