Install Tensorflow GPU with CUDA 10.1 for python on Windows
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Install Tensorflow GPU with CUDA 10.1 for python on Windows,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2761字,纯文字阅读大概需要4分钟。
内容图文
![Install Tensorflow GPU with CUDA 10.1 for python on Windows](/upload/InfoBanner/zyjiaocheng/956/e7273a96e58848a48d95cf99c55c2323.jpg)
How to install Tensorflow GPU with CUDA 10.0 for python on Windows
在cuda 10.0的windows上安装Tensorflow GPU, python
ref: https://www.pytorials.com/how-to-install-tensorflow-gpu-with-cuda-10-0-for-python-on-windows/
Before start, Notations neet to know:
Tasks (四位爷):
- 装 visual studio
- 装 Cuda
- 装 cuDNN
- 装 tensorflow
那么问题是,这四位爷的版本得对上。 所以就有人做了这个东西:https://github.com/fo40225/tensorflow-windows-wheel
里面详细列出来每个安装包对应的四位爷的版本。
以这一行:
1.14.0\py37\GPU\cuda101cudnn76avx2 VS2019 16.1 10.1.168_425.25/7.6.0.64 AVX2 Python 3.7/Compute 3.0,3.5,5.0,5.2,6.1,7.0,7.5
解释一下:
- 第一列: 在github这个项目里,whl安装包的路径
- 第二列: Compiler版本
- 第三列: CUDA版本:10.1.168_425.25, cuDNN版本:7.6.0.64
- 第四列: SIMD,即你的CPU支持的指令集是否支持AVX2. The tool
coreinfo
can tell you. get to know it by google. - 第五列: python版本,GPU的compute能力。ref: https://developer.nvidia.com/cuda-gpus
按照这5列的信息,就一步步装四位爷。
- 装 visual studio
- 装 Cuda
- 装 cuDNN
- 装 tensorflow
第一位爷,装 visual studio:上microsoft visual studio去下载安装vs 2019, 需了解tf是c++写的。
第二位爷,装 Cuda 10.1, 上nvidia去下载安装即可。(20190825: 注意cuda10.1 暂时不被pyTorch支持,如果有pyTorch需求的,建议cuda10.0)
装完cmd里检查版本号:nvcc --version
You will see something like this:
----
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Apr_24_19:11:20_Pacific_Daylight_Time_2019
Cuda compilation tools, release 10.1, V10.1.168
第三位爷,装cuDNN,
Goto https://developer.nvidia.com/cudnn (Membership required) After login Download the following: cuDNN v7.6.0.64 Library for Windows [your version] for me Windows 10 Goto downloaded folder and extract cudnn-10.0-windows10-x64-v7.3.1.20.zip Go inside extracted folder and copy all files and folder from cuda folder (Bin, include, lib) and paste them to “C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1”.
对应的文件放在对应的所在文件夹中。
参考: https://zhuanlan.zhihu.com/p/49832216
第四位爷:装tensorflow-gpu
建立一个virtual environment with python=3.7 用conda。指定env的名字py3env-gpu, python版本=3.7, 顺带装上包:pip six numpu wheel mock 等。cmd中运行:
conda create -n py3env-gpu python=3.7 pip six numpy wheel mock
参考上述‘第一列: 在github这个项目里,whl安装包的路径’
下载tensorflow-gpu的whl安装文件,from this github: https://github.com/fo40225/tensorflow-windows-wheel/tree/master/1.14.0/py37/GPU/cuda101cudnn76avx2
这里面是001和002的压缩分卷,全下载解压。
cmd里到这个解压路径,用pip install 安装tensorflow-gpu,就完成了。
途中如果遇到connection的问题,用privoxy开个http代理,再在cmd里配一下代理服务器即可。参考:https://www.cnblogs.com/sonictl/p/11248627.html
个人经验,仅供参考,致敬:https://zhuanlan.zhihu.com/p/49832216
内容总结
以上是互联网集市为您收集整理的Install Tensorflow GPU with CUDA 10.1 for python on Windows全部内容,希望文章能够帮你解决Install Tensorflow GPU with CUDA 10.1 for python on Windows所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。