最近复现deepsort,发现run demo 出现错误module ‘numpy‘ has no attribute ‘float‘.

最近复现deepsort,发现run demo 出现错误module ‘numpy‘ has no attribute ‘float‘._第1张图片

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相关代码处,如下图所示:

最近复现deepsort,发现run demo 出现错误module ‘numpy‘ has no attribute ‘float‘._第2张图片

 

最近复现deepsort,发现run demo 出现错误module ‘numpy‘ has no attribute ‘float‘._第3张图片

重新运行demo文件,成功 

你可能感兴趣的:(numpy,python,机器学习)