未来警告:不赞成将issubdtype的第二个参数从“float”转换为“np.floating”

2024-06-17 11:10:03 发布

您现在位置:Python中文网/ 问答频道 /正文

在更新了我的NumpyTensorflow之后,我收到了这些警告。我已经试过these,但没什么用,每一个建议都会受到赞赏。

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
2018-01-19 17:11:38.695932: I C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

Tags: oftofromnumpyregister警告tensorflowas
3条回答

你可以升级h5py

pip install --upgrade h5py

这可能是您的情况,也可能不是您的情况,但同样的警告也会从h5py包中发出:

/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

对于任何带着这个问题来这里的人来说,它是一个known h5py issue,由numpy 1.14引入的。如开发人员所述:

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.

。。。所以是无害的。修复程序刚刚merged到master。但在更新发布之前,解决方法是将numpy降级到以前的版本:

pip install numpy==1.13.0

使用修复更新RC构建。应使用以下命令:

pip install h5py==2.8.0rc1

更新(最终版):现在有一个完整的版本。所以你可以简单地运行:

pip install --upgrade h5py

我试过这些,它也为我解决了同样的问题,只要把这些放在你的代码上面

import os
os.environ["TF_CPP_MIN_LOG_LEVEL"]="3"

相关问题 更多 >