导入tensorflow ,提示警告信息的消除
2018-03-14 15:03
891 查看
1.版本信息
tensorflow 1.12.0numpy 1.12.1
2.警告信息
导入tensorflow 时会出现的警告信息FutureWarning: Conversion of the second argument of issubdtype from
floatto
np.floatingis deprecated. In future, it will be treated as
np.float64 == np.dtype(float).type.
3.解决
首先,只是一个警告信息,可以不用管,不影响使用想去掉的话,网上有“强行”不显示警告信息的方法
也有不同的朋友导入不同库时报这个信息,解决的也有装不同库的办法
我在StackOverflow上看到一个比较有理有据的解决方案
This might or might not be your case, but the same warning is also spit out from h5py package:
/home/user/bin/conda3/lib/python3.6/site-packages/h5py/init.py:34: 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
For anyone coming here with this problem, it is a known h5py issue, introduced with numpy 1.14. As stated by the devs:
You can ignore the warning, it’s not going to cause any issues at the moment, but you should upgrade to the next release of h5py when it becomes available.
so it’s harmless. The fix has just been merged to master. But until the update is released, the workaround is to downgrade numpy to a previous version:
pip install numpy==1.13.0
就是说,这个问题是由于numpy1.14版本引入的警告信息,没有影响,在新版本更新之前,有效的方法是降级到numpy 1.13.0
可是我的已有版本是1.12.1啊。。。
试着升级到1.13.0,果然解决了问题。看来至少是保证 numpy 1.13 这个版本没问题
如果tensorflow 版本高的话,可能会要求高版本的numpy了,需要注意下。
原问题页面
小问题,in case u need.
相关文章推荐
- 忽略PyCharm4中特定的警告提示信息
- [gcc] gcc编译时不提示警告信息
- 在论坛中出现各种疑难问题: MSSQL 导入导出的时候提示 无法检索源数据和目标数据的列信息
- [经验总结]std::string的警告信息不能消除的解决办法
- servlet 提示信息弹出警告框后成功重定向
- Wordpress里提示警告信息creating default object from empty value in *** 的解决方法
- bootstrap错误警告信息提示
- BB10 Cascades: 如何消除“Unresolved inclusion”警告信息
- Android之置顶提示警告信息的控件AlertDialog
- warning C4996: '_snprintf' was declared deprecated 警告信息的消除方法
- struts2 控制台警告信息 FilterDispatcher <<< is deprecated! 提示 FilterDispatcher 过时
- Oracle数据库案例整理-导入导出Oracle数据失败-导出Oracle数据时提示导出可疑信息
- yii 中设置提示成功信息,错误提示信息,警告信息
- VS 提示:请考虑使用 app.config 将程序集“XXX”从版本“XX”重新映射到版本“XX”,以解决冲突并消除警告。
- Eclipse中警告信息和拼写错误提示设置方法
- 在向navicat导入数据时,运行sql文件,报错首行信息提示:mysql server has gone away
- 解决安装驱动时提示的“未签名的驱动程序”警告信息!!
- BB10 Cascades: 如何消除“Unresolved inclusion”警告信息
- Assigning to "id<CALayerDelegate> _Nullable" from incompatible type "ZXCapture *const __strong" 的警告提示信息
- 如何验证警告/确认/提示信息