windows10安装GPU版pytorch步骤(全程离线)

1、首先安装cuda10.0和cudnn。

软件:
cuda_10.0.130_411.31_win10
cudnn-10.0-windows10-x64-v7.6.4.38
下载的cuda包括显卡驱动,所以不用单独安装显卡,再安装cuda。
参考:
https://blog.csdn.net/qq_37296487/article/details/83028394

2、离线安装pytorch

2.1 下载软件

torch-1.2.0-cp36-cp36m-win_amd64.whl
torchvision-0.4.0-cp36-cp36m-win_amd64.whl

进入https://download.pytorch.org/whl/torch_stable.html根据cuda版本和python版本下载相对应的pytorch版本。
在这里插入图片描述
在这里插入图片描述

2.2 安装步骤

D:\cuda文件>pip install torch-1.2.0-cp36-cp36m-win_amd64.whl
Processing d:\cuda文件\torch-1.2.0-cp36-cp36m-win_amd64.whl
Requirement already satisfied: numpy in d:\anaconda3\lib\site-packages (from torch==1.2.0) (1.14.3)
distributed 1.21.8 requires msgpack, which is not installed.
Installing collected packages: torch
Successfully installed torch-1.2.0

有时安装成功,但是会报缺少msgpack包,下载msgpack-python和msgpack包,并离线安装。

D:\cuda文件>pip install torchvision-0.4.0-cp36-cp36m-win_amd64.whl
Processing d:\cuda文件\torchvision-0.4.0-cp36-cp36m-win_amd64.whl
Requirement already satisfied: six in f:\programdata\anaconda3\lib\site-packages (from torchvision==0.4.0) (1.11.0)
Requirement already satisfied: numpy in f:\programdata\anaconda3\lib\site-packages (from torchvision==0.4.0) (1.14.3)
Requirement already satisfied: pillow>=4.1.1 in f:\programdata\anaconda3\lib\site-packages (from torchvision==0.4.0) (5.1.0)
Requirement already satisfied: torch in f:\programdata\anaconda3\lib\site-packages (from torchvision==0.4.0) (1.2.0)
Installing collected packages: torchvision
Successfully installed torchvision-0.4.0

安装成功后查看torch版本。

C:\Users\XXX>python
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import torch
>>>
>>> print(torch.__version__)
1.2.0
>>>
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值