diff --git a/paddle/fluid/jit/serializer_utils.cc b/paddle/fluid/jit/serializer_utils.cc index 54b0e7831ea73776bb6ec06817ad727e7a2581a0..2899fb97f735c124c1e9eb2c8093ba782b6e069b 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);