【YOLO问题记录】AttributeError: module ‘numpy‘ has no attribute ‘int‘.解决方案

问题:在训练YOLO模型的时候出现了以下报错:

AttributeError: module 'numpy' has no attribute 'int'.
`np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
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

报错内容翻译:

AttributeError:模块“numpy”没有属性“int”。
`np.int` 是内置 `int` 的已弃用别名。 为避免在现有代码中出现此错误,请单独使用“int”。 这样做不会修改任何行为并且是安全的。 替换 `np.int` 时,您可能希望使用例如 `np.int64` 或 `np.int32` 来指定精度。 如果您想查看当前的使用情况,请查看发行说明链接以获取更多信息。
别名最初在 NumPy 1.20 中被弃用; 有关更多详细信息和指南,请参阅原始发行说明,网址为:
     https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

说白了又是numpy的版本的问题,在pycharm软件包管理里换一个版本

(换版本就行,方法无所谓,使用命令行也行)

参考博客:AttributeError: module numpy has no attribute int .报错解决方案

猜你喜欢

转载自blog.csdn.net/weixin_51972142/article/details/130664737
今日推荐