关于import tensorflow出现的FutureWarning问题及解决

关于import tensorflow出现的FutureWarning问题及解决

在安装完tensorflow-gpu之后,等不及进去python里试验一下是否装成功,结果第一个import tensorflow as tf 便出现了如下问题: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)])
FutureWarning
在搜寻网上资料后,试了其他文章的一些方法,总结解决的办法,在两台设备上装都能解决并且有效。

解决办法:
对h5py进行升级安装,在 CMD命令行输入pip install h5py==2.8.0rc1,如下:

尽管如此,在python里import tensorflow还是会报这样的错误
接下来,对numpy包进行降级,我的是最新的版本1.17.1,网上资料有说降到<1.17,于是我干脆降到了1.16,如下:

接下来import tensorflow便没有报那样的错误了
成功

评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值