Skip to content

Commit

Permalink
Perform evaluation upon training completion (#1529)
Browse files Browse the repository at this point in the history
  • Loading branch information
LZHgrla authored Apr 8, 2024
1 parent 2c4516c commit e258c84
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mmengine/runner/loops.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ def run(self) -> torch.nn.Module:
self._decide_current_val_interval()
if (self.runner.val_loop is not None
and self._epoch >= self.val_begin
and self._epoch % self.val_interval == 0):
and (self._epoch % self.val_interval == 0
or self._epoch == self._max_epochs)):
self.runner.val_loop.run()

self.runner.call_hook('after_train')
Expand Down Expand Up @@ -288,7 +289,8 @@ def run(self) -> None:
self._decide_current_val_interval()
if (self.runner.val_loop is not None
and self._iter >= self.val_begin
and self._iter % self.val_interval == 0):
and (self._iter % self.val_interval == 0
or self._iter == self._max_iters)):
self.runner.val_loop.run()

self.runner.call_hook('after_train_epoch')
Expand Down

0 comments on commit e258c84

Please sign in to comment.