From 77d9b4c391c1088aee7968604cf74212aa34aab4 Mon Sep 17 00:00:00 2001 From: WangZhen <23097963+0x45f@users.noreply.github.com> Date: Wed, 15 Mar 2023 10:40:21 +0800 Subject: [PATCH] [JitLayer]Fix Load error when load path like 'export.jit' (#46279) --- paddle/fluid/jit/serializer_utils.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/paddle/fluid/jit/serializer_utils.cc b/paddle/fluid/jit/serializer_utils.cc index 54b0e7831e..2899fb97f7 100644 --- a/paddle/fluid/jit/serializer_utils.cc +++ b/paddle/fluid/jit/serializer_utils.cc @@ -70,6 +70,9 @@ const std::vector> PdmodelFilePaths( std::string format_path = path; ReplaceAll(&format_path, R"(\\)", "/"); ReplaceAll(&format_path, R"(\)", "/"); + if (format_path.find("/") == std::string::npos) { + format_path = "./" + format_path; + } std::string layer_name = format_path.substr(format_path.find_last_of("/") + 1); -- GitLab