windows下配置pytorch

编程知识 更新时间:2023-05-02 17:09:14

我的电脑显卡

image.png

安装pytorch

参考:https://blog.csdn/sunqiande88/article/details/80085569

image.png

 

发现我的CUDA是9.2版本的,还要先把按错的卸载了,再装。气屎我了……

pip3 uninstall http://download.pytorch/whl/cu90/torch-0.4.1-cp37-cp37m-win_amd64.whl 
pip3 uninstall torchvision

然后安装:

pip3 install http://download.pytorch/whl/cu92/torch-0.4.1-cp37-cp37m-win_amd64.whl 
pip3 install torchvision

安装VS2015

参考:
https://blog.csdn/Poetry_And_Distance/article/details/79714869
https://jingyan.baidu/article/c45ad29c223421051753e23a.html
最后安装的是这个,密钥可用

Visual Studio Professional 2015 简体中文专业版
镜像SHA1:629E7154E2695F08A3C692C0B3F6CE19DF6D3A72
专业版激活密钥:HMGNV-WCYXV-X7G9W-YCX63-B98R2
http://download.microsoft/download/B/8/9/B898E46E-CBAE-4045-A8E2-2D33DD36F3C4/vs2015.pro_chs.iso

安装CUDA

参考:
https://docs.nvidia/cuda/cuda-installation-guide-microsoft-windows/index.html#axzz4TpI4c8vf
https://blog.csdn/fengbingchun/article/details/53892997
https://blog.csdn/cmat2/article/details/80407059
https://jingyan.baidu/article/b24f6c821a2f8b86bfe5da19.html

测试:

C:\Users\wangc>nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Tue_Jun_12_23:08:12_Central_Daylight_Time_2018
Cuda compilation tools, release 9.2, V9.2.148

安装CUDNN

参考:(ubuntu下)https://blog.csdn/lucifer_zzq/article/details/76675239

为什么需要安装cudnn
cuDNN的全称为NVIDIA CUDA® Deep Neural Network library,是NVIDIA专门针对深度神经网络(Deep Neural Networks)中的基础操作而设计基于GPU的加速库。cuDNN为深度神经网络中的标准流程提供了高度优化的实现方式,例如convolution、pooling、normalization以及activation layers的前向以及后向过程。
cuDNN只是NVIDIA深度神经网络软件开发包中的其中一种加速库。

然后测试pytorch能否正常使用GPU:

C:\Users\wangc>python
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
False
>>>

说明哪里不对。后来发现是我的显卡驱动太老了。然后去官网下载相应驱动,安装后终于变成了True。很激动。



作者:狗嗨旺
链接:https://www.jianshu/p/59b6b23c3d11
來源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。

更多推荐

windows下配置pytorch

本文发布于:2023-04-27 12:44:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/b65c3dce0f91dfc9efb79278e025fcaf.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:windows   pytorch

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 106956文章数
  • 26996阅读数
  • 0评论数