[更新时间:2019.1.29]Win10 +VS2017+ python3.67 + CUDA10 + cuDNNv7.4.1 + tensorflow-gpu 1.12.0 最新版

21 篇文章 1 订阅
20 篇文章 0 订阅

Win10 +VS2017+ python3.67 + CUDA10 + cuDNNv7.41 + tensorflow-gpu 1.12.0 最新版

 

官网的tensorflow 1.12只支持 cuda9.0  不支持10.0,不安装cuda9.0的话会出错。本文的目的是用最新版的CUDA10 + cuDNNv7.4.1来运行tensorflow 1.12
--------------------- 

CUDA安装
根据官网描述在下载CUDA之前请确保:

GPU型号兼容
支持的Windows版本
支持的Microsoft Visual Studio版本
cuda下载地址:https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exelocal

CUDA安装路径:“C:\ProgramData\NVIDIA GPU Computing Toolkit\v10” 

或者安装在D:\ProgramData\NVIDIA GPU Computing Toolkit\v10 后面下载的cudnn要放在CUDA安装路径中。
--------------------- 
 


 

 

cuDNN下载


cuDNN只是cuda的一个补丁。需要注册一个官网帐号, 下载地址:https://developer.nvidia.com/rdp/cudnn-archive

 

https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v7.4.1.5/prod/10.0_20181108/cudnn-10.0-windows10-x64-v7.4.1.5.zip

 

https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v7.3.1/prod/10.0_2018927/cudnn-10.0-windows10-x64-v7.3.1.20

解压缩下载的CuDnn文件,得到3个文件夹:bin, include, lib。

将这个三个文件夹复制到“C:\ProgramData\NVIDIA GPU Computing Toolkit\v10” (CUDA安装路径)

或者安装在D:\ProgramData\NVIDIA GPU Computing Toolkit\v10

之后确认环境变量:

确认CUDA_PATH和CUDA_PATH_V10已经存在。如果没有。

手动添加 “D:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin”到Path里面。

 
--------------------- 

如何验证是否正确安装了CUDA

在运行里面输入“cmd” 然后用命令“nvcc -V”进行测试 必须用大写的V,否则出错

即如下的代码

nvcc -V

运行的结果如下

 

==============================

pip安装Tensorflow-gpu

 注意:

目前tensorflow还不能支持cuda10.0,所以只能通过源码编译或者别人编译好的安装包安装。大神编译的各种版本的tensorflow安装包地址:https://github.com/fo40225/tensorflow-windows-wheel

根据说明找到资源路径:[1.11-1.12 必须安装cuda10]

 

https://raw.githubusercontent.com/fo40225/tensorflow-windows-wheel/master/1.12.0/py36/GPU/cuda100cudnn73avx2/tensorflow_gpu-1.12.0-cp36-cp36m-win_amd64.7z.001

https://raw.githubusercontent.com/fo40225/tensorflow-windows-wheel/master/1.12.0/py36/GPU/cuda100cudnn73avx2/tensorflow_gpu-1.12.0-cp36-cp36m-win_amd64.7z.002

下载完成后:2个文件合并一下。用7zip或winrar打开解压即可

tensorflow_gpu-1.12.0-cp36-cp36m-win_amd64.whl

复制到C:\Windows\System32文件夹下,然后执行命令:pip install tensorflow_gpu-1.12.0-cp36-cp36m-win_amd64.whl(若运行失败,会报错在哪个文件夹不能找到该文件,再把.whl文件移到指定文件夹即可)

或cmd直接 cd 到存放的目录 D:\Tensorflow下

【需要翻~~~墙,否则 installed tensorboard-1.12.0 无法安装,导致安装失败】

 

最后pip list查看:

 

运行测试

最后输入python

输入import tensorflow as tf 查看:

完工~~体验gpu的运算速度吧

Win10 +VS2017+ python3.67 + CUDA10 + cuDNNv7.3.1 + tensorflow-gpu 1.12.0 最新版

还有问题的,可以加群264191384 注明(warp)

WIN10+cuda10+pytorch+py3.68环境下,warpctc 编译不成功的解决办法

自编译tensorflow: 1.python3.5,tensorflow1.12; 2.支持cuda10.0,cudnn7.3.1,TensorRT-5.0.2.6-cuda10.0-cudnn7.3; 3.支持mkl,无MPI; 软硬件硬件环境:Ubuntu16.04,GeForce GTX 1080 配置信息: hp@dla:~/work/ts_compile/tensorflow$ ./configure WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown". You have bazel 0.19.1 installed. Please specify the location of python. [Default is /usr/bin/python]: /usr/bin/python3 Found possible Python library paths: /usr/local/lib/python3.5/dist-packages /usr/lib/python3/dist-packages Please input the desired Python library path to use. Default is [/usr/local/lib/python3.5/dist-packages] Do you wish to build TensorFlow with XLA JIT support? [Y/n]: XLA JIT support will be enabled for TensorFlow. Do you wish to build TensorFlow with OpenCL SYCL support? [y/N]: No OpenCL SYCL support will be enabled for TensorFlow. Do you wish to build TensorFlow with ROCm support? [y/N]: No ROCm support will be enabled for TensorFlow. Do you wish to build TensorFlow with CUDA support? [y/N]: y CUDA support will be enabled for TensorFlow. Please specify the CUDA SDK version you want to use. [Leave empty to default to CUDA 10.0]: Please specify the location where CUDA 10.0 toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]: /usr/local/cuda-10.0 Please specify the cuDNN version you want to use. [Leave empty to default to cuDNN 7]: 7.3.1 Please specify the location where cuDNN 7 library is installed. Refer to README.md for more details. [Default is /usr/local/cuda-10.0]: Do you wish to build TensorFlow with TensorRT support? [y/N]: y TensorRT support will be enabled for TensorFlow. Please specify the location where TensorRT is installed. [Default is /usr/lib/x86_64-linux-gnu]:/home/hp/bin/TensorRT-5.0.2.6-cuda10.0-cudnn7.3/targets/x86_64-linux-gnu Please specify the locally installed NCCL version you want to use. [Default is to use https://github.com/nvidia/nccl]: Please specify a list of comma-separated Cuda compute capabilities you want to build with. You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus. Please note that each additional compute capability significantly increases your build time and binary size. [Default is: 6.1,6.1,6.1]: Do you want to use clang as CUDA compiler? [y/N]: nvcc will be used as CUDA compiler. Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]: Do you wish to build TensorFlow with MPI support? [y/N]: No MPI support will be enabled for TensorFlow. Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native -Wno-sign-compare]: Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: Not configuring the WORKSPACE for Android builds. Preconfigured Bazel build configs. You can use any of the below by adding "--config=" to your build command. See .bazelrc for more details. --config=mkl # Build with MKL support. --config=monolithic # Config for mostly static monolithic build. --config=gdr # Build with GDR support. --config=verbs # Build with libverbs support. --config=ngraph # Build with Intel nGraph support. --config=dynamic_kernels # (Experimental) Build kernels into separate shared objects. Preconfigured Bazel build configs to DISABLE default on features: --config=noaws # Disable AWS S3 filesystem support. --config=nogcp # Disable GCP support. --config=nohdfs # Disable HDFS support. --config=noignite # Disable Apacha Ignite support. --config=nokafka # Disable Apache Kafka support. --config=nonccl # Disable NVIDIA NCCL support. Configuration finished 编译: hp@dla:~/work/ts_compile/tensorflow$ bazel build --config=opt --config=mkl --verbose_failures //tensorflow/tools/pip_package:build_pip_package 卸载已有tensorflow: hp@dla:~/temp$ sudo pip3 uninstall tensorflow 安装自己编译的成果: hp@dla:~/temp$ sudo pip3 install tensorflow-1.12.0-cp35-cp35m-linux_x86_64.whl
nss-3.67.0-4.el7_9.x86_64.rpm 是一个用于 Linux 操作系统的软件包。它是 Network Security Services(NSS)的一个版本。NSS 是一个开源的密码库,提供安全的网络通信功能。它包含了多种密码学库,用来支持 SSL(Secure Sockets Layer)、TLS(Transport Layer Security)、PKCS(Public-Key Cryptography Standards)和其他加密协议的实现。 这个特定的软件包版本是针对 Red Hat Enterprise Linux 7.9(Red Hat 企业级 Linux 7.9)的 x86_64 架构进行优化的。RPM(Red Hat Package Manager)是一种用于在 Red Hat 系统上安装、更新和管理软件包的工具。这个软件包通过 RPM 的格式打包,并以 .rpm 作为文件扩展名。 安装 nss-3.67.0-4.el7_9.x86_64.rpm 软件包可以提供更高级别的网络安全和加密功能,能够保护传输的数据免受恶意攻击者的窃听和篡改。此外,软件包还可能包含与 NSS 相关的开发工具和库,允许开发人员在其应用程序中使用 NSS 的功能。 通过命令行或图形化界面管理工具,您可以使用适当的命令或界面操作来安装或卸载 nss-3.67.0-4.el7_9.x86_64.rpm 软件包。在安装之前,可能需要满足软件包的依赖关系,以确保安装过程顺利进行。 总之,nss-3.67.0-4.el7_9.x86_64.rpm 是一个提供网络安全功能的软件包,适用于 Red Hat Enterprise Linux 7.9。安装该软件包可以增强系统的安全性,并提供密码学库,支持各种加密协议的实现。
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值