1 先检查电脑支持哪个版本的cuda
方法详见:
https://blog.youkuaiyun.com/Candy_GL/article/details/79435151
2 查找tensorflow cuda cudnn之间的版本匹配问题
该图出自tensorflow中文社区 “安装”专栏页。
3 安装过程参考下文
https://blog.youkuaiyun.com/weixin_39290638/article/details/80045236
4 出现的一些问题:
1,
运行程序时出现:
2017-11-02 01:56:21.698935: I C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
是指CPU有一些基础指令集如AVX 但是tensorflow—gpu无法使用,可能降低结果效率但是不影响运行,只是个warning,如果是在GPU上跑,则可完全忽略。
2.
运行一个小程序:
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)
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
print (sess.run©)
#任务完成 关闭会话
sess.close()
显示:
其中有一行:Ignoring visible gpu device (device: 0, name: GeForce GTX 650, pci bus id: 0000:01:00.0, compute capability: 3.0) with Cuda compute capability 3.0. The minimum required Cuda capability is 3.7.
是指由于GPU计算能力不足,只有3.0 而要求至少3.7 因此忽略了GPU而使用CPU(电脑自带的显卡,GPU较差)
3.
Anaconda安装过程出现failed to create menu.解决办法
https://blog.youkuaiyun.com/qq_38851897/article/details/79336251 使用默认安装路径亲测有效
https://blog.youkuaiyun.com/qq_37162754/article/details/79630974