From f4917c09e187c039b76cd9e70e93bf84938258bb Mon Sep 17 00:00:00 2001 From: harsh1504660 Date: Wed, 6 Aug 2025 20:28:18 +0530 Subject: [PATCH 1/2] fix - update-called-attribute --- src/anomalib/post_processing/post_processor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/anomalib/post_processing/post_processor.py b/src/anomalib/post_processing/post_processor.py index 9fa0ba4404..2d7dba3433 100644 --- a/src/anomalib/post_processing/post_processor.py +++ b/src/anomalib/post_processing/post_processor.py @@ -135,7 +135,7 @@ def on_validation_epoch_end(self, trainer: Trainer, pl_module: LightningModule) del trainer, pl_module if self.enable_thresholding: # compute threshold values - if self._image_threshold_metric.update_called: + if getattr(self._image_threshold_metric, "_update_called", False): self._image_threshold.copy_(self._image_threshold_metric.compute()) self._image_threshold_metric.reset() if self._pixel_threshold_metric.update_called: From 6fcf4c25576643dc8acc91f3bd7ad67f2cb8d9a6 Mon Sep 17 00:00:00 2001 From: harsh1504660 Date: Thu, 7 Aug 2025 15:42:34 +0530 Subject: [PATCH 2/2] Modified the post processor for new _update_called method --- src/anomalib/post_processing/post_processor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/anomalib/post_processing/post_processor.py b/src/anomalib/post_processing/post_processor.py index 2d7dba3433..22b62ff7c0 100644 --- a/src/anomalib/post_processing/post_processor.py +++ b/src/anomalib/post_processing/post_processor.py @@ -143,7 +143,7 @@ def on_validation_epoch_end(self, trainer: Trainer, pl_module: LightningModule) self._pixel_threshold_metric.reset() if self.enable_normalization: # compute normalization values - if self._image_min_max_metric.update_called: + if getattr(self._image_min_max_metric, "_update_called", False): image_min, image_max = self._image_min_max_metric.compute() self.image_min.copy_(image_min) self.image_max.copy_(image_max)