From c56d9026de80c37cec65ae72cafbf9a31a70dbf1 Mon Sep 17 00:00:00 2001 From: flame Date: Mon, 18 Mar 2019 16:56:18 +0800 Subject: [PATCH] return saved targets' name list (#16240) --- python/paddle/fluid/io.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/paddle/fluid/io.py b/python/paddle/fluid/io.py index 7372ddc915..74950c1f6b 100644 --- a/python/paddle/fluid/io.py +++ b/python/paddle/fluid/io.py @@ -895,7 +895,7 @@ def save_inference_model(dirname, True is supported. Returns: - None + target_var_name_list(list): The fetch variables' name list Raises: ValueError: If `feed_var_names` is not a list of basestring. @@ -954,6 +954,7 @@ def save_inference_model(dirname, var, 1., name="save_infer_model/scale_{}".format(i)) uniq_target_vars.append(var) target_vars = uniq_target_vars + target_var_name_list = [var.name for var in target_vars] # when a pserver and a trainer running on the same machine, mkdir may conflict try: @@ -1010,6 +1011,7 @@ def save_inference_model(dirname, params_filename = os.path.basename(params_filename) save_persistables(executor, dirname, main_program, params_filename) + return target_var_name_list def load_inference_model(dirname, -- GitLab