From 5f2eaa7cb10ef2997898f069f161905287de6e76 Mon Sep 17 00:00:00 2001 From: Yang Nie Date: Mon, 6 Mar 2023 10:21:27 +0800 Subject: [PATCH] bugfix: set_epoch after reume --- ppcls/engine/engine.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ppcls/engine/engine.py b/ppcls/engine/engine.py index 38d5b710..ac7534dd 100755 --- a/ppcls/engine/engine.py +++ b/ppcls/engine/engine.py @@ -369,6 +369,9 @@ class Engine(object): 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): -- GitLab