def before_train_epoch(self, runner):
        """Evaluate the model only at the start of training by epoch."""
        if not (self.by_epoch and self.initial_flag):
            return
        if self.start is not None and runner.epoch >= self.start:
            self.after_train_epoch(runner)
        self.initial_flag = False
Evaluate the model only at the start of training by epoch.
ControlNet-v1-1-nightly/annotator/uniformer/mmcv/runner/hooks/evaluation.py