Skip to content

Commit

Permalink
modify hpo reporting place from on_validation_epoch_end to on_train_e…
Browse files Browse the repository at this point in the history
…poch_end
  • Loading branch information
eunwoosh committed May 31, 2022
1 parent 184df04 commit 4ea9d44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions external/anomaly/ote_anomalib/callbacks/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ def _get_progress(self, stage: str = "train") -> float:

return self._progress

def on_validation_epoch_end(self, trainer, pl_module):
super().on_validation_epoch_end(trainer, pl_module)
def on_train_epoch_end(self, trainer, pl_module):
super().on_train_epoch_end(trainer, pl_module)
score = None
metric = getattr(self.update_progress_callback, 'metric', None)
if metric in trainer.logged_metrics:
score = float(trainer.logged_metrics[metric])
progress = int(self._get_progress('predict'))
progress = int(self._get_progress('train'))
self.update_progress_callback(progress=progress, score=score)

def _update_progress(self, stage: str):
Expand Down

0 comments on commit 4ea9d44

Please sign in to comment.