当前位置:   article > 正文

最近复现deepsort,发现run demo 出现错误module ‘numpy‘ has no attribute ‘float‘._`np.float` was a deprecated alias for the builtin

`np.float` was a deprecated alias for the builtin `float`. to avoid this err

AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'cfloat'? 

这是pycharm给的报错原因,笔者查了相关资料,发现都太麻烦了,仔细看错误,会发现系统推荐我们使用np.float64 这种用法,所以我们先定位到np.float相关代码处,如下图所示:

 

重新运行demo文件,成功 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/541682
推荐阅读
相关标签
  

闽ICP备14008679号