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