diff --git a/tests/anomaly/test_dpad.py b/tests/anomaly/test_dpad.py index bdf449c6..86c9cf13 100644 --- a/tests/anomaly/test_dpad.py +++ b/tests/anomaly/test_dpad.py @@ -79,7 +79,10 @@ def test_full(self): self.model.save(dirname=join(rootdir, "tmp", "dpad")) loaded_model = DeepPointAnomalyDetector.load(dirname=join(rootdir, "tmp", "dpad")) loaded_alarms = loaded_model.get_anomaly_label(self.test_data) - n_loaded_alarms = np.sum(loaded_alarms.to_pd().values != 0) + try: + n_loaded_alarms = np.sum(loaded_alarms.to_pd().values != 0) + except: + n_loaded_alarms = sum(loaded_alarms.to_pd().values != 0) self.assertAlmostEqual(n_loaded_alarms, n_alarms, delta=1) # Evaluation