cocodataset / cocoapi

COCO API - Dataset @ http://cocodataset.org/
Other
6.05k stars 3.75k forks source link

Error in cocoeval.py: Deprecated attribute np.float used, should be replaced with float | line 378 #665

Open cori4nder opened 6 months ago

cori4nder commented 6 months ago

Hello,

I encountered an error while using the cocoeval.py module from the COCO API. The error message indicates the usage of a deprecated attribute np.float, which should be replaced with float to avoid future compatibility issues.

Error message:

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.


To fix this issue, I suggest replacing the line of code in cocoeval.py that contains np.float with float.

Thank you for your attention to this matter.

windymv025 commented 3 months ago

Same issues

gurudk commented 2 months ago

Just install use pip: pip install pycocotools, it works for me. Installing from git is for backward compatibility.