From 5e4fbfb41dddfd15c1997695e78b34ec2e28c578 Mon Sep 17 00:00:00 2001 From: chengmo Date: Wed, 17 Jun 2020 13:00:16 +0800 Subject: [PATCH] fix load --- core/trainers/framework/startup.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/core/trainers/framework/startup.py b/core/trainers/framework/startup.py index 2687dcdd..362592e6 100644 --- a/core/trainers/framework/startup.py +++ b/core/trainers/framework/startup.py @@ -38,11 +38,9 @@ class StartupBase(object): if dirname is None or dirname == "": return print("going to load ", dirname) - if is_fleet: - context["fleet"].load_persistables(context["exe"], dirname) - else: - fluid.io.load_persistables( - context["exe"], dirname, main_program=main_program) + fluid.io.load_persistables( + context["exe"], dirname, main_program=main_program) + print("load from {} success".format(dirname)) class SingleStartup(StartupBase): @@ -81,7 +79,6 @@ class PSStartup(StartupBase): "startup_program"] with fluid.program_guard(train_prog, startup_prog): context["exe"].run(startup_prog) - self.load(context, True) context["status"] = "train_pass" @@ -99,7 +96,7 @@ class CollectiveStartup(StartupBase): "startup_program"] with fluid.program_guard(train_prog, startup_prog): context["exe"].run(startup_prog) - self.load(context, True) + self.load(context, main_program=train_prog) context["status"] = "train_pass" -- GitLab