提交 b44ad9b3 编写于 作者: T typhoonzero

clean up

上级 43f86d5c
...@@ -223,7 +223,6 @@ def build_program(is_train, main_prog, startup_prog, args): ...@@ -223,7 +223,6 @@ def build_program(is_train, main_prog, startup_prog, args):
assert model_name in model_list, "{} is not in lists: {}".format(args.model, assert model_name in model_list, "{} is not in lists: {}".format(args.model,
model_list) model_list)
model = models.__dict__[model_name]() model = models.__dict__[model_name]()
params_grads = []
with fluid.program_guard(main_prog, startup_prog): with fluid.program_guard(main_prog, startup_prog):
py_reader = fluid.layers.py_reader( py_reader = fluid.layers.py_reader(
capacity=16, capacity=16,
...@@ -248,10 +247,10 @@ def build_program(is_train, main_prog, startup_prog, args): ...@@ -248,10 +247,10 @@ def build_program(is_train, main_prog, startup_prog, args):
params["learning_strategy"]["name"] = args.lr_strategy params["learning_strategy"]["name"] = args.lr_strategy
optimizer = optimizer_setting(params) optimizer = optimizer_setting(params)
params_grads = optimizer.backward(avg_cost)
if args.fp16: if args.fp16:
master_params_grads = [] master_params_grads = []
params_grads = optimizer.backward(avg_cost)
tmp_role = main_prog._current_role tmp_role = main_prog._current_role
OpRole = fluid.core.op_proto_and_checker_maker.OpRole OpRole = fluid.core.op_proto_and_checker_maker.OpRole
main_prog._current_role = OpRole.Backward main_prog._current_role = OpRole.Backward
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册