DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`.

Posted a little cabbage

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`.相关的知识,希望对你有一定的参考价值。

问题

F:\\Tools\\Python3.8.9\\lib\\site-packages\\skimage\\morphology\\_skeletonize.py:256: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  0, 0, 0, 0, 0, 0, 0, 0, 0], dtype=np.bool)

解决方法

将F:\\Tools\\Python3.8.9\\lib\\site-packages\\skimage\\morphology_skeletonize.py:256行的np.bool 修改为bool

以上是关于DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`.的主要内容,如果未能解决你的问题,请参考以下文章

DeprecationWarning 之后的“用户不允许执行操作”

Mongoose 警告:DeprecationWarning:当前的服务器发现和监控引擎已弃用?

如何确定地抑制 Python 中的 DeprecationWarning?

如何在 Python 中修复“<string> DeprecationWarning: invalid escape sequence”?

如何修复 PySide2 QPixmapCache.find() DeprecationWarning?

使用 scikit-learn 进行递归特征消除和网格搜索:DeprecationWarning