Skip to content

Commit

Permalink
[numpy] Fix users of NumPy APIs that are removed in NumPy 2.0.
Browse files Browse the repository at this point in the history
This change migrates users of APIs removed in NumPy 2.0 to their recommended replacements (https://numpy.org/doc/stable/numpy_2_0_migration_guide.html).

This CL makes the following changes:

* `np.NAN` -> `np.nan`

PiperOrigin-RevId: 659605386
  • Loading branch information
hawkinsp authored and TF Object Detection Team committed Aug 5, 2024
1 parent 34f03db commit b4c7ea9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion research/object_detection/utils/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def compute_average_precision(precision, recall):
if precision is None:
if recall is not None:
raise ValueError("If precision is None, recall must also be None")
return np.NAN
return np.nan

if not isinstance(precision, np.ndarray) or not isinstance(
recall, np.ndarray):
Expand Down

0 comments on commit b4c7ea9

Please sign in to comment.