diff --git a/python/paddle/fluid/io.py b/python/paddle/fluid/io.py index 7372ddc9158f0bba5f09861cc8cdd97af0179d4b..74950c1f6b59c527894c697b7547844c5688d8d1 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,