配置tensorflow-gpu 的艰辛之路

菜肴之 tensorflow-gpu

在这里插入图片描述
本次实验环境选择:在这里插入图片描述

材料

1.下载anaconda3_4.5.4(python_3.6)

网址:
1.清华源->建议
2.官网

2.下载 cuDNNv7.0.5 for CUDA 9.0

官网

3.下载 CUDA9.0

官网多试几次

4. base环境安装tensorflow-gpu1.8

添加豆瓣源:

pip3 install -i https://pypi.douban.com/simple tensorflow-gpu==1.8

测试是否安装成功:


(base) C:\Users\DELL>python
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf

安装tf时会出现问题:C:\Users\DELL\Anaconda3\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype fromfloattonp.floatingis deprecated. In future, it will be treated asnp.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters
解决方法:
发现是h5py版本错误->到Environment: TensorFlow
查找tf1.8.0对应的包的正确版本->利用豆瓣源下载

pip install -i https://pypi.douban.com/simple h5py==2.8.0

结果:Successfully uninstalled h5py-2.7.1 Successfully installed h5py-2.8.0
再测试:

(base) C:\Users\DELL>python
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> a = tf.constant([0])
>>> print(a)
Tensor("Const:0", shape=(1,), dtype=int32)

OK!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值