Traceback (most recent call last): File "06_fit_line.py", line 62, in <module> print(least_squares_fit(left_lines)) File "06_fit_line.py", line 58, in least_squares_fit return np.array([point_min, point_max], dtype=np.int) File "/home/kmam/anaconda3/envs/yolo/lib/python3.8/site-packages/numpy/__init__.py", line 305, in __getattr__ raise AttributeError(__former_attrs__[attr]) 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
时间: 2023-07-15 12:13:20 浏览: 118
浅谈Python traceback的优雅处理
这是一个 Python 错误提示,告诉你在文件 "06_fit_line.py" 的第 62 行出现了错误。具体错误信息是模块 numpy 没有 int 属性。在 NumPy 1.20 版本中,np.int 是一个不推荐使用的别名,建议直接使用 int,或者使用 np.int64、np.int32 等指定精度的整数类型。你需要修改代码,将 np.int 替换为 int,或者使用指定精度的整数类型。
阅读全文