Skip to content

Commit 369d259

Browse files
committed
fix save step bug
1 parent 1671a37 commit 369d259

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

core/trainers/framework/runner.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,14 @@ def _executor_dataloader_train(self, model_dict, context):
209209

210210
if save_step_interval >= 1 and batch_id % save_step_interval == 0 and context[
211211
"is_infer"] == False:
212-
if context["fleet_mode"]:
213-
if context["fleet_mode"].upper() == "PS":
214-
train_prog = context["model"][model_dict[
215-
"name"]]["main_program"]
216-
elif not context["is_fleet"] or context[
217-
"fleet_mode"].upper() == "COLLECTIVE":
212+
if context["fleet_mode"].upper() == "PS":
213+
train_prog = context["model"][model_dict["name"]][
214+
"main_program"]
215+
print("condition 1")
216+
else:
218217
train_prog = context["model"][model_dict["name"]][
219218
"default_main_program"]
219+
print("condition 2")
220220
startup_prog = context["model"][model_dict["name"]][
221221
"startup_program"]
222222
with fluid.program_guard(train_prog, startup_prog):

0 commit comments

Comments
 (0)