From b44ad9b383947cd6673504952ceaf81b17d9acf8 Mon Sep 17 00:00:00 2001 From: typhoonzero Date: Thu, 10 Jan 2019 20:22:54 +0800 Subject: [PATCH] clean up --- fluid/PaddleCV/image_classification/train.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fluid/PaddleCV/image_classification/train.py b/fluid/PaddleCV/image_classification/train.py index 03ac4573..8c6a6700 100644 --- a/fluid/PaddleCV/image_classification/train.py +++ b/fluid/PaddleCV/image_classification/train.py @@ -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, model_list) model = models.__dict__[model_name]() - params_grads = [] with fluid.program_guard(main_prog, startup_prog): py_reader = fluid.layers.py_reader( capacity=16, @@ -248,10 +247,10 @@ def build_program(is_train, main_prog, startup_prog, args): params["learning_strategy"]["name"] = args.lr_strategy optimizer = optimizer_setting(params) - params_grads = optimizer.backward(avg_cost) if args.fp16: master_params_grads = [] + params_grads = optimizer.backward(avg_cost) tmp_role = main_prog._current_role OpRole = fluid.core.op_proto_and_checker_maker.OpRole main_prog._current_role = OpRole.Backward -- GitLab