安装tensorflow-gpu的悲催之路 win10+anconda+cuda9.0+cudnn7.4.1+tf1.12.0(踩坑无数的孩子

看了很多教程之后,决定采用anconda来安装tensorflow,因为都说gpu的版本速度更快,所以选择gpu版本。
下面详细介绍在win10的配置情况
Nvidia ----- Geforce MX150
怎么看电脑是否有GPU

在开始中找到并打开NVIDIA控制面板(或桌面右键)有NVIDIA控制面板则有GPU
点开,找到帮助菜单,在下拉的菜单里选择系统信息选项,
在弹出的系统信息窗口里有两个菜单页面:显示和组件,选择组件,可以看到很多文件名,在文件名中找到NVCUDA,在产品名称一列可以看到该NVCUDA的版本
(but,好像版本低于看到的版本也没有问题,博主就是;高于就不行了)

选定对应版本,开始安装

CUDA:https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html
cuDNN:https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#installwindows

如上链接,安装即可

再安装anconda,因为很大!!所以建议,用清华源安装(网上有很多)

最后是安装tf,,吃了很多苦,我哭

先是安装成了cpu版本,之后又……

最后终于成功了呜呜呜

说一下踩坑
1、请一定记住对应版本!!!包括cpu还是GPU 包括1.0还是2.0

pip install tensorflow-gpu==2.0.0 -i https://pypi.tuna.tsinghua.edu.cn/simple

这种是gpu 2.0的标准格式,(改版本即可)

安装好了之后,进入python

import tensorflow

报错……
主要是版本tf和numpy不匹配

```cpp
D:\anconda\envs\tfenv\lib\site-packages\tensorflow\python\framework\dtypes.py:523: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
D:\anconda\envs\tfenv\lib\site-packages\tensorflow\python\framework\dtypes.py:524: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
D:\anconda\envs\tfenv\lib\site-packages\tensorflow\python\framework\dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
D:\anconda\envs\tfenv\lib\site-packages\tensorflow\python\framework\dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
D:\anconda\envs\tfenv\lib\site-packages\tensorflow\python\framework\dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
D:\anconda\envs\tfenv\lib\site-packages\tensorflow\python\framework\dtypes.py:532: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])```

所以我们需要改变numpy的版本

pip install numpy==1.16.0 -i https://pypi.tuna.tsinghua.edu.cn/simple

OK了

分享国内源


阿里云:http://mirrors.aliyun.com/pypi/simple/

中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

华中理工大学:http://pypi.hustunique.com/

山东理工大学:http://pypi.sdutlinux.org/ 

https://pypi.tuna.tsinghua.edu.cn/simple 清华源

豆瓣:http://pypi.douban.com/simple/
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值