踩坑记---Win10安装anaconda及tensorflow-cpu版

为了安好anaconda的tensorflow真的是花了很长时间,现在终于安好了,来分享一下经验吧

首先一定要先安好anaconda,直接去清华镜像站就好。

https://mirrors.tuna.tsinghua.edu.cn/

安装最近版本就好(2019年的那几个都可以),现在tensorflow已经可以兼容python3.7。

检验自己anaconda是否安装成功,按下Win+R,打开cmd,输入

conda --version

如果出现

conda 4.5.4

类似的,那么恭喜你, anaconda安装成功!!!
接下来就是安装tensorflow.

相信官网

https://tensorflow.google.cn/install

可以直接在官网找到下载方法,或者直接输入以下(以下遇到选择直接输y就好)

conda create -n tensorflow python=3.6

然后再输入

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

这里tensorflow有许多版本,我选择了1.12.0的。
可以输入

anaconda search -t conda tensorflow

选择自己想要的版本就好,记着把上面的1.12.0改掉就好。
然后就下载完成了,输入:

conda list

如果可以找到tensorflow说明安装成功。
但是接下来我调用tensorflow出现以下提示

C:\Users\dell\Anaconda3\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)])
C:\Users\dell\Anaconda3\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)])
C:\Users\dell\Anaconda3\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)])
C:\Users\dell\Anaconda3\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)])
C:\Users\dell\Anaconda3\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)])
C:\Users\dell\Anaconda3\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)])
C:\Users\dell\Anaconda3\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters

按照提示一项项的改正就好了,比如第一句

C:\Users\dell\Anaconda3\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)])

先找到路径

C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py

找到

_np_qint8 = np.dtype([("qint8", np.int8, 1)])

将其改成

_np_quint8 = np.dtype([("quint8", np.uint8, (1,))])

就好了,下面的以此类推就好啦!!!

大功告成

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值