Skip to content

Commit 10f8f64

Browse files
authored
Update writing_your_own_callbacks.py (#21671)
Fix `AttributeError: `np.Inf` was removed in the NumPy 2.0 release. Use `np.inf` instead.` exception
1 parent 80b59a2 commit 10f8f64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

guides/writing_your_own_callbacks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def on_train_begin(self, logs=None):
333333
# The epoch the training stops at.
334334
self.stopped_epoch = 0
335335
# Initialize the best as infinity.
336-
self.best = np.Inf
336+
self.best = np.inf
337337

338338
def on_epoch_end(self, epoch, logs=None):
339339
current = logs.get("loss")

0 commit comments

Comments
 (0)