提交 369d2592 编写于 作者: L liuyuhui

fix save step bug

上级 1671a378
...@@ -209,14 +209,14 @@ class RunnerBase(object): ...@@ -209,14 +209,14 @@ class RunnerBase(object):
if save_step_interval >= 1 and batch_id % save_step_interval == 0 and context[ if save_step_interval >= 1 and batch_id % save_step_interval == 0 and context[
"is_infer"] == False: "is_infer"] == False:
if context["fleet_mode"]:
if context["fleet_mode"].upper() == "PS": if context["fleet_mode"].upper() == "PS":
train_prog = context["model"][model_dict[ train_prog = context["model"][model_dict["name"]][
"name"]]["main_program"] "main_program"]
elif not context["is_fleet"] or context[ print("condition 1")
"fleet_mode"].upper() == "COLLECTIVE": else:
train_prog = context["model"][model_dict["name"]][ train_prog = context["model"][model_dict["name"]][
"default_main_program"] "default_main_program"]
print("condition 2")
startup_prog = context["model"][model_dict["name"]][ startup_prog = context["model"][model_dict["name"]][
"startup_program"] "startup_program"]
with fluid.program_guard(train_prog, startup_prog): with fluid.program_guard(train_prog, startup_prog):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册