From 8d78490153215ce7c0a17088dcd26715e919e135 Mon Sep 17 00:00:00 2001 From: Peter Hawkins Date: Wed, 14 Aug 2024 12:37:38 -0700 Subject: [PATCH] [numpy] Fix test failures under NumPy 2.0. PiperOrigin-RevId: 663017350 Change-Id: I1210d5a9ff9d211d86a13370178dc2ece5e76564 --- pip_pkg.sh | 2 +- tests_release.sh | 2 +- tf_slim/metrics/classification_test.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pip_pkg.sh b/pip_pkg.sh index 9989b0e..66fdd7a 100755 --- a/pip_pkg.sh +++ b/pip_pkg.sh @@ -1,4 +1,4 @@ -# Copyright 2023 The TF-Slim Authors. +# Copyright 2024 The TF-Slim Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests_release.sh b/tests_release.sh index 6b0f533..d7f1b6c 100755 --- a/tests_release.sh +++ b/tests_release.sh @@ -1,4 +1,4 @@ -# Copyright 2023 The TF-Slim Authors. +# Copyright 2024 The TF-Slim Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tf_slim/metrics/classification_test.py b/tf_slim/metrics/classification_test.py index 6f46d01..f71ca34 100644 --- a/tf_slim/metrics/classification_test.py +++ b/tf_slim/metrics/classification_test.py @@ -201,7 +201,7 @@ def testSomeCorrect(self): sess.run([f1_op]) # Threshold 0 will have around 0.5 precision and 1 recall yielding an F1 # score of 2 * 0.5 * 1 / (1 + 0.5). - self.assertAlmostEqual(2 * 0.5 * 1 / (1 + 0.5), f1.eval()) + self.assertAlmostEqual(2 * 0.5 * 1 / (1 + 0.5), f1.eval(), places=6) def testAllIncorrect(self): inputs = np.random.randint(0, 2, size=(10000, 1))