Skip to content

Fix: Replace deprecated np.Inf with np.inf for NumPy 2.0 compatibility #236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

scottXchoo
Copy link

@scottXchoo scottXchoo commented Aug 2, 2025

What does this PR do?

This PR replaces the deprecated usage of np.Inf with np.inf to ensure compatibility with NumPy 2.0 and above.

Why is this change necessary?

The current code fails under NumPy 2.0 with the following error:

AttributeError: np.Inf was removed in the NumPy 2.0 release. Use np.inf instead.

This breaks the training pipeline for users on the latest NumPy version.

What files are affected?

  • utils/tools.py — line initializing self.val_loss_min

Additional Notes

This is a minimal fix that does not change any model behavior or logic. It simply restores compatibility with newer environments (e.g., Colab or Python 3.11+ with NumPy ≥ 2.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant