cmd中运行import tensorflow as tf出现FutureWarning解决办法与pip版本升级问题

cmd中运行import tensorflow as tf出现FutureWarning解决办法与pip版本升级问题

参考:https://blog.csdn.net/libo_learner/article/details/83056426

解决cmd中import tensorflow as tf运行时出现的问题:

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。

打开cmd或者使用anaconda安装的tensorflow,首先打开开始菜单中的Annconda Prompt,自己使用的是cmd
在这里插入图片描述
接着执行语句:pip install h5py==2.8.0rc1,等待安装完毕:
并使用 import tensorflow as tf进行测试,不再出现警告
在这里插入图片描述

注意事项:

在执行pip install h5py==2.8.0rc1可能遇到pip版本太低导致无法执行这条语句
所以我们必须先更新pip版本
在cmd中执行:python -m pip install --upgrade pip
或者python -m pip install -U pip,二者都可以更新

在更新的过程中可能遇到下载速度过慢,导致超时问题,这是由于更新网站在国外,自己在家更新使用wifi尝试10次都失败,使用手机热点成功更新。归根结底是由于网速过慢。这种现象在执行上面的pip install h5py==2.8.0rc1也遇到过,如下图:
在这里插入图片描述
更新pip完成后,cmd输入:pip --version,可查看当前版本是否更新成功。
在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值