From 2c5fee533b71b45cc03a0da42796ad568690f1fa Mon Sep 17 00:00:00 2001 From: flame Date: Sat, 16 Mar 2019 11:31:11 +0800 Subject: [PATCH] save infer model bug fix (#16224) * save infer model bug fix * test=release/1.3 --- python/paddle/fluid/io.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/paddle/fluid/io.py b/python/paddle/fluid/io.py index 24e102b6c2..7372ddc915 100644 --- a/python/paddle/fluid/io.py +++ b/python/paddle/fluid/io.py @@ -948,10 +948,11 @@ def save_inference_model(dirname, # TODO(Superjomn) add an IR pass to remove 1-scale op. with program_guard(main_program): uniq_target_vars = [] - for var in target_vars: + for i, var in enumerate(target_vars): if isinstance(var, Variable): - var1 = layers.scale(var, 1.) - uniq_target_vars.append(var1) + var = layers.scale( + var, 1., name="save_infer_model/scale_{}".format(i)) + uniq_target_vars.append(var) target_vars = uniq_target_vars # when a pserver and a trainer running on the same machine, mkdir may conflict -- GitLab