win7 +Anaconda3-2.4.1-Windows-x86_64(python3.5.1)+tensorflow_gpu-1.6+cuda_9.0.176_windows+cudnn-9.0

配个TensorFlow_gpu折腾了差不多两天,真是醉了。现在总结一下,以防自己在后面再次掉坑。

原本电脑安装的TensorFlow是CPU版的,所以直接用命令 "pip uninstall tensorflow"将原来的TensorFlow卸载。卸载完后安装tensorflow_gpu版本。

掉的坑1:下载好文件“tensorflow_gpu-1.7.0-cp35-cp35m-win_amd64.whl”,将其放在c盘的根目录下,然后用命令“pip install c:\tensorflow_gpu-1.7.0-cp35-cp35m-win_amd64.whl”安装,运行后发现需要cuda9.0的版本,但是由于本人电脑早已安装了cuda8.0,然后自己猜想,可能是TensorFlow的版本太高了,所以对应的才需要cuda9.0。为了匹配我的cuda8.0,我毅然下了早一点的TensorFlow版本“tensorflow_gpu-1.6.0-cp35-cp35m-win_amd64.whl”。将TensorFlow1.7删掉,安装1.6版本,发现还是需要cuda9.0.好吧,接下来还是乖乖去下cuda9.0吧。

掉的坑2:不知道英伟达的服务器端怎么了,我下载cuda9.0的过程是一波三折的,下了很多次都没有成功。同样,cudnn for cuda9.0的下载也是蛮艰辛的,尝试了几个版本,最终只能下载才成功。


安装过程:(参照https://blog.csdn.net/sb19931201/article/details/53648615)

(1)安装Anaconda3-2.4.1-Windows-x86_64

(2)安装tensorflow_gpu-1.6.0-cp35-cp35m-win_amd64.whl

(3)安装cuda9.0

(4)安装cudnn for cuda9.0

(5)测试

import tensorflow as tf
#Creates a graph.
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))

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值