win10 64 配置tensorflow1.9注意事项

本文详细记录了在Win10 64位系统下,使用Anaconda环境安装TensorFlow1.9 GPU版本,配合CUDA 9.0和cuDNN v7.0的过程,包括遇到的问题及解决方案。特别指出CUDA安装路径的变化,并提供了CUDA和cuDNN的下载链接,以及安装后系统环境变量的设置。最后展示了运行示例和遇到的未知警告。

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

我的电脑是win10 64 用的anconda,安装的是tensorflow1.9 gpu+CUDA 9.0 + cudnn v7.0 版本,在安装过程捣鼓了好久,尝试了还几个版本,以下是注意事项:

特别提醒:我的cuda默认装在C:\Users\hcl\AppData\Local\Temp\CUDA,但是安装完成却跑到了C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0 我也不知道为啥

 

安装过程中参考的一个博客https://blog.youkuaiyun.com/sb19931201/article/details/53648615

1:目前最新的tensorflow1.9只能配置CUDA 9.0 + cudnn v7.0 ,照着tensorflow官网来配置就没问题

https://tensorflow.google.cn/install/install_windows#common_installation_problems

2:cuda9.0的安装过程 一直都是next,把cuDNN下载下来以后,解压并复制至 安装目录C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0 即可

cuda下载链接:https://developer.nvidia.com/cuda-toolkit-archive

cuDNN下载链接:https://developer.nvidia.com/rdp/cudnn-archive

3:在cuda安装完成后,我又添加了两个路径到系统环境变量中:

     C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib

    C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64

4:展示一下运行效果图:第一次运行hi出现红色框内的警告,在别人电脑上也会出现这个,目前也不知道是为什么,正在研究中。。。

例程输入:

import tensorflow as tf
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
c = tf.matmul(a, b)
# Creates a session with log_device_placement set to True.
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
# Runs the op.
print(sess.run(c))

 输出

warning: Debugger speedups using cython not found. Run '"D:\F\Anaconda3\python.exe" "C:\Users\hcl\.p2\pool\plugins\org.python.pydev.core_6.3.3.201805051638\pysrc\setup_cython.py" build_ext --inplace' to build.
pydev debugger: starting (pid: 14604)
D:\F\Anaconda3\lib\site-packages\h5py\__init__.py:34: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
2018-07-22 23:02:45.289253: I T:\src\github\tensorflow\tensorflow\core\platform\cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2018-07-22 23:02:45.482112: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1392] Found device 0 with properties: 
name: GeForce GTX 1050 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.62
pciBusID: 0000:01:00.0
totalMemory: 4.00GiB freeMemory: 3.30GiB
2018-07-22 23:02:45.483065: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1471] Adding visible gpu devices: 0
2018-07-22 23:02:46.329448: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:952] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-07-22 23:02:46.329842: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:958]      0 
2018-07-22 23:02:46.330076: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:971] 0:   N 
2018-07-22 23:02:46.330418: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1084] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3025 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
Device mapping:
/job:localhost/replica:0/task:0/device:GPU:0 -> device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1
2018-07-22 23:02:46.484913: I T:\src\github\tensorflow\tensorflow\core\common_runtime\direct_session.cc:288] Device mapping:
/job:localhost/replica:0/task:0/device:GPU:0 -> device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1

MatMul: (MatMul): /job:localhost/replica:0/task:0/device:GPU:0
2018-07-22 23:02:46.487999: I T:\src\github\tensorflow\tensorflow\core\common_runtime\placer.cc:886] MatMul: (MatMul)/job:localhost/replica:0/task:0/device:GPU:0
a: (Const): /job:localhost/replica:0/task:0/device:GPU:0
2018-07-22 23:02:46.488641: I T:\src\github\tensorflow\tensorflow\core\common_runtime\placer.cc:886] a: (Const)/job:localhost/replica:0/task:0/device:GPU:0
b: (Const): /job:localhost/replica:0/task:0/device:GPU:0
2018-07-22 23:02:46.489333: I T:\src\github\tensorflow\tensorflow\core\common_runtime\placer.cc:886] b: (Const)/job:localhost/replica:0/task:0/device:GPU:0
[[22. 28.]
 [49. 64.]]

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值