加载中…
正文 字体大小:

windows10 安装 tensorflow-gpu

(2017-06-23 21:47:04)
标签:

tensorflow-gpu

windows10

分类: 深度学习
1. 准备工作
1.1 安装python
目前支持python3.6,直接下载anaconda3,
Anaconda 4.4.0 For Windows python3.6 64位
https://www.continuum.io/downloads
下载完后,直接安装,在配置环境变量环节,选择需要配置环境变量
1.2 下载 visual studio community 2017安装VC编译环境
https://www.visualstudio.com/zh-hans/, 下载 visual studio community 2017
安装的时候,在工作负载的tab页面,选择使用c++的桌面开发
环境变量设置
在PATH环境变量添加
D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64
D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE
新建LIB环境变量
D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\lib\x64
新建INCLUDE环境变量
D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include
1.3 cuda安装
下载cuda https://developer.nvidia.com/cuda-downloads
直接安装,自动配置cuda相应的环境变量,可以去环境变量配置页面看看CUDA_PATH的设置
下载cuDNN,https://developer.nvidia.com/cudnn
cudnn-8.0-windows10-x64-v5.1,解压文件,将文件夹放到cuda的安装文件夹下。拷贝cudnn bin下的cudnn64_5.dll至
cuda安装文件夹下的bin下面。
2. tensorflow-gpu安装
pip install --upgrade -I setuptools
pip install --upgrade tensorflow-gpu
3. 测试
import tensorflow as tf
a = tf.constant(2.0, dtype=tf.float32)
b = tf.constant(3.0, dtype=tf.float32)
sum = tf.add(a, b)
with tf.Session() as sess:
    print(sess.run([sum]))
运行日志:
D:\Anaconda3\python.exe E:/PycharmProject/deeplearning/demo.py
2017-06-19 11:18:46.312109: W c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations.
2017-06-19 11:18:46.312532: W c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE2 instructions, but these are available on your machine and could speed up CPU computations.
2017-06-19 11:18:46.312924: W c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
2017-06-19 11:18:46.313309: W c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-06-19 11:18:46.313686: W c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-06-19 11:18:46.314053: W c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-06-19 11:18:46.314408: W c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-06-19 11:18:46.314767: W c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
2017-06-19 11:18:48.199218: I c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:940] Found device 0 with properties:
name: GeForce 940MX
major: 5 minor: 0 memoryClockRate (GHz) 1.189
pciBusID 0000:01:00.0
Total memory: 4.00GiB
Free memory: 3.36GiB
2017-06-19 11:18:48.199659: I c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:961] DMA: 0
2017-06-19 11:18:48.199868: I c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:971] 0:   Y
2017-06-19 11:18:48.200090: I c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:1030] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce 940MX, pci bus id: 0000:01:00.0)
[5.0]
Process finished with exit code 0

0

阅读 评论 收藏 转载 喜欢 打印举报
已投稿到:
  • 评论加载中,请稍候...
发评论

    发评论

    以上网友发言只代表其个人观点,不代表新浪网的观点或立场。

      

    新浪BLOG意见反馈留言板 不良信息反馈 电话:4006900000 提示音后按1键(按当地市话标准计费) 欢迎批评指正

    新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 会员注册 | 产品答疑

    新浪公司 版权所有