Win10 & Tensorflow-GPU1.13.1 & CUDA10.0 & cuDNN v7.6 安装

该博客介绍了如何在Windows 10环境下配置Tensorflow-GPU 1.13.1,包括安装CUDA 10.0和cuDNN v7.6的详细步骤,以及针对Tensorflow-gpu不支持CUDA 10.1的情况。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  1.  环境说明

    硬件: GTX 1070

    系统:Windows 10 Enterprise Version 1809 Update March 2019

    软件: Python 3.7

    说明:目前最新的CUDA版本是10.1 亲测不支持TensorFlow-gpu 所以安装CUDA10.0

  2. 安装CUDA和cuDNN

    2.1. CUDA 10.0

    下载地址:https://developer.nvidia.com/cuda-10.0-download-archive

    2.2. cuDNN v7.6 for CUDA 10.0

    下载地址:https://developer.nvidia.com/rdp/cudnn-download

    解压后将目录中文件分别添加到C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0相应目录即可。

  3. 安装Tensorflow GPU 1.13.1


                
自编译tensorflow1.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
### 回答1: 要安装tensorflow-gpu1.13.1,您需要先安装CUDAcuDNN。然后,您可以使用pip命令安装tensorflow-gpu1.13.1安装命令如下: 1. 安装CUDAcuDNN 请根据您的操作系统和CUDA版本下载安装CUDAcuDNN安装完成后,请将CUDAcuDNN的路径添加到环境变量中。 2. 安装tensorflow-gpu1.13.1 打开命令行窗口,输入以下命令: pip install tensorflow-gpu==1.13.1 等待安装完成后,您就可以使用tensorflow-gpu1.13.1了。 ### 回答2: TensorFlow是一种流行的机器学习框架,可以用于构建和训练各种深度学习模型。在使用TensorFlow时,通常可以选择使用CPU或GPU进行计算。通过使用GPU进行计算,可以大大提高训练模型的速度。 要安装TensorFlow-GPU 1.13.1,需要按照以下步骤进行操作: 1. 首先,确保你的计算机上已经安装了兼容的NVIDIA GPU驱动程序。你可以在NVIDIA官方网站上找到适合你的GPU的最新驱动程序,并按照说明进行安装。 2. 接下来,你需要安装CUDA Toolkit,这是NVIDIA提供的一种用于进行GPU计算的平台和工具集。请根据你的GPU型号下载安装适配的CUDA Toolkit版本。安装时,可以选择安装所需的组件和示例程序。 3. 然后,你需要安装cuDNNCUDA Deep Neural Network Library),它是用于深度学习模型的GPU加速库。请前往NVIDIA开发者网站,下载与你的CUDA版本匹配的cuDNN版本,并按照安装说明进行安装。 4. 在上述步骤完成后,你可以通过pip安装TensorFlow-GPU 1.13.1。打开终端或命令提示符窗口,并运行以下命令: pip install tensorflow-gpu==1.13.1 这样就会自动下载安装TensorFlow-GPU的指定版本及其依赖项。 5. 安装完成后,你可以尝试导入TensorFlow库以验证是否安装成功。在Python中,运行以下代码: import tensorflow as tf 如果没有出现错误提示,则说明TensorFlow-GPU 1.13.1已经成功安装并可以正常使用了。 总之,安装TensorFlow-GPU 1.13.1需要先安装兼容的NVIDIA GPU驱动程序、CUDA Toolkit和cuDNN,然后通过pip安装TensorFlow-GPU。确保按照官方文档和安装说明进行操作,以确保安装过程顺利进行,并获得最佳性能和稳定性。 ### 回答3: 要安装TensorFlow-GPU 1.13.1,你需要以下几个步骤: 1. 首先,你需要确保你的计算机具备一个兼容的GPU设备,并且已经安装了合适的GPU驱动程序。你可以查找你的GPU型号,并从官方网站下载安装对应的驱动程序。 2. 为了正确地安装TensorFlow-GPU 1.13.1,你需要一个支持CUDA Toolkit 10.0的版本。你可以从NVIDIA官方网站上下载安装CUDA Toolkit。确保你选择与你的GPU和操作系统兼容的适当版本。 3.安装CUDA Toolkit之后,你需要安装cuDNNCUDA® Deep Neural Network library)。你可以从NVIDIA官方网站上注册并下载适用于你的CUDA版本的cuDNN。 4. 确保你的Python环境已经安装好了,而且是兼容的。TensorFlow-GPU 1.13.1要求使用Python 3.5、3.6或3.7,并且需要32位或64位的Windows操作系统,或者是Linux操作系统。 5. 现在,你可以通过使用pip或Anaconda包管理器来安装TensorFlow-GPU 1.13.1。你可以运行以下命令来安装: pip install tensorflow-gpu==1.13.1 如果你使用Anaconda,你可以运行以下命令来创建一个新的虚拟环境,并安装TensorFlow-GPU 1.13.1: conda create -n <环境名称> python=3.6 conda activate <环境名称> conda install tensorflow-gpu==1.13.1 安装完成后,你可以通过导入TensorFlow来验证安装是否成功: import tensorflow as tf print(tf.__version__) 如果成功打印出了1.13.1,那么恭喜你,你已经成功安装TensorFlow-GPU 1.13.1!现在你可以开始使用它进行深度学习任务。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值