From 73ac6f25290512850820988dc559a0181bc4fc4c Mon Sep 17 00:00:00 2001 From: liuyuhui Date: Wed, 16 Sep 2020 12:05:34 +0800 Subject: [PATCH] fix bug --- core/trainers/framework/runner.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/core/trainers/framework/runner.py b/core/trainers/framework/runner.py index 839e3ed4..0a1cec84 100644 --- a/core/trainers/framework/runner.py +++ b/core/trainers/framework/runner.py @@ -209,12 +209,20 @@ class RunnerBase(object): if save_step_interval >= 1 and batch_id % save_step_interval == 0 and context[ "is_infer"] == False: - if context["fleet_mode"].upper() == "PS": - train_prog = context["model"][model_dict["name"]][ - "main_program"] + if context["is_fleet"]: + if context["fleet_mode"].upper() == "PS": + train_prog = context["model"][model_dict[ + "name"]]["main_program"] + print("condition 1 of bath id:{}".format( + batch_id)) + else: + train_prog = context["model"][model_dict[ + "name"]]["default_main_program"] + print("condition 2") else: train_prog = context["model"][model_dict["name"]][ "default_main_program"] + print("condition 3") startup_prog = context["model"][model_dict["name"]][ "startup_program"] with fluid.program_guard(train_prog, startup_prog): -- GitLab