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

灰太狼 2023-07-08 02:49 75阅读 0赞

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 安装步骤

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

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

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

安装成功后查看torch版本。

  1. C:\Users\XXX>python
  2. Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] on win32
  3. Type "help", "copyright", "credits" or "license" for more information.
  4. >>>
  5. >>> import torch
  6. >>>
  7. >>> print(torch.__version__)
  8. 1.2.0
  9. >>>

发表评论

表情:
评论列表 (有 0 条评论,75人围观)

还没有评论,来说两句吧...

相关阅读