diff --git a/paddlex/cv/models/base.py b/paddlex/cv/models/base.py index ac8989ff83980bf45d7705985353435e6e19a9e6..b66c54d99918daebdf90687696ed78cafe86c961 100644 --- a/paddlex/cv/models/base.py +++ b/paddlex/cv/models/base.py @@ -512,6 +512,7 @@ class BaseAPI: epoch_start_time = time.time() # 每间隔save_interval_epochs, 在验证集上评估和对模型进行保存 + self.completed_epochs += 1 eval_epoch_start_time = time.time() if (i + 1) % save_interval_epochs == 0 or i == num_epochs - 1: current_save_dir = osp.join(save_dir, "epoch_{}".format(i + 1)) @@ -525,7 +526,6 @@ class BaseAPI: return_details=True) logging.info('[EVAL] Finished, Epoch={}, {} .'.format( i + 1, dict2str(self.eval_metrics))) - self.completed_epochs += 1 # 保存最优模型 best_accuracy_key = list(self.eval_metrics.keys())[0] current_accuracy = self.eval_metrics[best_accuracy_key]