win7 安装 TensorFlow-GPU

1.环境:

windows7 python3.6 安装tensorflow-gpu
显卡:GT 635M https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html

下载cuda8.0 https://developer.nvidia.com/cuda-80-ga2-download-archive
https://blog.csdn.net/jiugeshao/article/details/76370137
需要注意的第三点是,CUDA8.0对应的cuDNN版本是5.1,CUDA9.0对应的cuDNN7.0。同时,cuDNN可以同时安装在CUDA8.0和9.0中,而cuDNN7.0只能对CUDA9.0及以上适用。
下载cudnn5.1 https://www.e-learn.cn/content/python/1825494

测试

# python 3.6
import tensorflow as tf
a = tf.constant([1.0, 2.0, 3.0], shape=[3], name='a')
b = tf.constant([1.0, 2.0, 3.0], shape=[3], name='b')
c = a + b
sess = tf.Session(config = tf.ConfigProto(log_device_placement=True))
print(sess.run(c))

结果:

2019-01-25 18:29:51.249306: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX
Device mapping: no known devices.
add: (Add): /job:localhost/replica:0/task:0/device:CPU:0
b: (Const): /job:localhost/replica:0/task:0/device:CPU:0
a: (Const): /job:localhost/replica:0/task:0/device:CPU:0
2019-01-25 18:29:51.951113: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:1030] Found device 0 with properties: 
name: GeForce GT 635M major: 2 minor: 1 memoryClockRate(GHz): 1.32
pciBusID: 0000:01:00.0
totalMemory: 2.00GiB freeMemory: 1.94GiB
2019-01-25 18:29:51.951113: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:1093] Ignoring visible gpu device (device: 0, name: GeForce GT 635M, pci bus id: 0000:01:00.0, compute capability: 2.1) with Cuda compute capability 2.1. The minimum required Cuda capability is 3.0.
2019-01-25 18:29:51.951113: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\direct_session.cc:299] Device mapping:

2019-01-25 18:29:51.951113: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\placer.cc:874] add: (Add)/job:localhost/replica:0/task:0/device:CPU:0
2019-01-25 18:29:51.951113: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\placer.cc:874] b: (Const)/job:localhost/replica:0/task:0/device:CPU:0
2019-01-25 18:29:51.951113: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\placer.cc:874] a: (Const)/job:localhost/replica:0/task:0/device:CPU:0
[2. 4. 6.]

Process finished with exit code 0

怎样知道tensorflow计算用的是CPU还是GPU
https://blog.csdn.net/Arctic_Beacon/article/details/83536376
https://www.jianshu.com/p/f5d8787d64c5
https://blog.csdn.net/LoseInVain/article/details/78814091
tensorflow_gpu InvalidArgumentErrorhttps://blog.csdn.net/luxgang/article/details/83116564
tensorflow 使用CPU而不使用GPU的问题解决

你可能感兴趣的:(win7 安装 TensorFlow-GPU)