菜肴之 tensorflow-gpu
本次实验环境选择:
材料
1.下载anaconda3_4.5.4(python_3.6)
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 from
floatto
np.floatingis deprecated. In future, it will be treated as
np.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!