yolov5使用Grad-Cam进行热力图可视化
牧星成环:
非常有用:
error 报错解决:
np.int->int 即可
原错误:Transferred 360/361 items
Traceback (most recent call last):
File "Heatmap.py", line 129, in
model = yolov5_heatmap(**get_params())
File "Heatmap.py", line 37, in __init__
colors = np.random.uniform(0, 255, size=(len(model_names), 3)).astype(np.int)
File "/root/miniconda3/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
|