FutureWarning: Passing (type, 1) or ‘1type‘ as a synonym of type is deprecated; in a future version

import tensorflow出现一堆乱七八糟的东西
在这里插入图片描述
/home/ubuntu/anaconda3/envs/ztf/lib/python3.6/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_qint8 = np.dtype([(“qint8”, np.int8, 1)])
/home/ubuntu/anaconda3/envs/ztf/lib/python3.6/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_quint8 = np.dtype([(“quint8”, np.uint8, 1)])
/home/ubuntu/anaconda3/envs/ztf/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:528: 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)])
/home/ubuntu/anaconda3/envs/ztf/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:529: 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)])
/home/ubuntu/anaconda3/envs/ztf/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:530: 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)])
/home/ubuntu/anaconda3/envs/ztf/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:535: 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)])

本人在Ubuntu下安装tensorflow-gpu==1.13.1出现上述警告,虽然不影响程序的运行,但是出现这些警告让我感觉很不舒服,于是进行解决。

首先,我觉得应该是tensorflow和已经存在的numpy版本不兼容导致,根据提示:

在这里插入图片描述
我将现有的numpy ==1.17.4升级到numpy ==1.18.0后,问题没有解决!!
于是百度了一下。。。。

这个xiongdei跟我遇到相同的问题:
在这里插入图片描述
在这里插入图片描述

https://blog.youkuaiyun.com/weixin_43981221/article/details/103049129

https://blog.youkuaiyun.com/qq_41975844/article/details/99622948

Ta是通过改变源码解决的。我认为这样做并不好。

坚持认为是版本不兼容的问题,于是继续百度找tensorflow和numpy对应版本关系。

最终找到如下博客:
在这里插入图片描述
Ta也遇到相同的问题,并且给出了解决办法。
将numpy换位1.16.0版本,成功解决!!!
https://blog.youkuaiyun.com/joyce_ff/article/details/103534152

总结:
tensorflow-gpu == 1.13.1
keras == 2.1.5
numpy == 1.16.0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

机器不学习我学习

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值