From 637c5b9249bb04d5918f898c51e23935e95717c7 Mon Sep 17 00:00:00 2001 From: MaJun-cn <39088575+MaJun-cn@users.noreply.github.com> Date: Thu, 13 Jul 2023 14:45:37 +0800 Subject: [PATCH] align the infer_model format of Paddle2.0 (#85) Co-authored-by: majun16 --- python/paddle/fluid/io.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/paddle/fluid/io.py b/python/paddle/fluid/io.py index db88331040fa7..252f7000bfd14 100644 --- a/python/paddle/fluid/io.py +++ b/python/paddle/fluid/io.py @@ -1369,6 +1369,9 @@ def save_inference_model(dirname, with program_guard(main_program): uniq_target_vars = [] for i, var in enumerate(target_vars): + if isinstance(var, Variable): + var = layers.scale( + 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]