From d8dbf834d81d7cb053a342483cfd67af2b6dbbee Mon Sep 17 00:00:00 2001 From: dawn1206 <74669568+dawn1206@users.noreply.github.com> Date: Tue, 23 Nov 2021 14:28:36 +0800 Subject: [PATCH] fix backslash misunderstood as escape character when generating code in Windows (#706) * fix escape character * Delete .idea directory * delete space behind "prim.list_unpack" --- x2paddle/core/program.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x2paddle/core/program.py b/x2paddle/core/program.py index 0012930..09d0270 100644 --- a/x2paddle/core/program.py +++ b/x2paddle/core/program.py @@ -109,7 +109,7 @@ class PaddleGraph(object): layer = PaddleLayer( layer_id, kernel, inputs, outputs, scope_name=scope_name, **kwargs) self.layers[layer_id] = layer - if layer.kernel in ["prim.list_unpack" , "prim.tuple_unpack"]: + if layer.kernel in ["prim.list_unpack", "prim.tuple_unpack"]: self.has_unpack = True return layer_id @@ -388,7 +388,7 @@ class PaddleGraph(object): gen_codes( [ "paddle.disable_static()", - "params = paddle.load('{}')".format( + "params = paddle.load(r'{}')".format( osp.join(osp.abspath(code_dir), "model.pdparams")), "model = {}()".format(self.name), "model.set_dict(params, use_structured_name={})".format( -- GitLab