Skip to content

Fix Numpy 1.20 Deprecation Warning in cocoeval.py #505

@dketterer

Description

@dketterer

When I run the Python evaluation with Numpy 1.20 I get this DeprecationWarning in cocoeval.py line 378 and 379:

/pycocotools/cocoeval.py:378: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, 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.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  tp_sum = np.cumsum(tps, axis=1).astype(dtype=np.float)

Please see the Numpy Documentation for details.

The np.float should exchanged for float.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions