From 25422ba5b7271074d065dfdbb61ab77ae966173f Mon Sep 17 00:00:00 2001 From: gaotingquan Date: Mon, 27 Dec 2021 06:30:01 +0000 Subject: [PATCH] fix: save latest model every epoch --- ppcls/engine/engine.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ppcls/engine/engine.py b/ppcls/engine/engine.py index 83a24a60..af4fbfeb 100644 --- a/ppcls/engine/engine.py +++ b/ppcls/engine/engine.py @@ -308,14 +308,14 @@ class Engine(object): self.output_dir, model_name=self.config["Arch"]["name"], prefix="epoch_{}".format(epoch_id)) - # save the latest model - save_load.save_model( - self.model, - self.optimizer, {"metric": acc, - "epoch": epoch_id}, - self.output_dir, - model_name=self.config["Arch"]["name"], - prefix="latest") + # save the latest model + save_load.save_model( + self.model, + self.optimizer, {"metric": acc, + "epoch": epoch_id}, + self.output_dir, + model_name=self.config["Arch"]["name"], + prefix="latest") if self.vdl_writer is not None: self.vdl_writer.close() -- GitLab