Skip to content

Commit

Permalink
bugfix: set_epoch after reume
Browse files Browse the repository at this point in the history
  • Loading branch information
flytocc committed Mar 6, 2023
1 parent b98d88e commit e6b4f1e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ppcls/engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ def train(self):
ema_module)
if metric_info is not None:
best_metric.update(metric_info)
if hasattr(self.train_dataloader.batch_sampler, "set_epoch"):
self.train_dataloader.batch_sampler.set_epoch(best_metric[
"epoch"])

for epoch_id in range(best_metric["epoch"] + 1,
self.config["Global"]["epochs"] + 1):
Expand Down

0 comments on commit e6b4f1e

Please sign in to comment.