diff --git a/lite/api/cxx_api.cc b/lite/api/cxx_api.cc index 9c0e8e1c343b8eb1705e871aa652e3254474391d..f6f7ec75e65ff54e3f3642822e51057d3522ae3a 100644 --- a/lite/api/cxx_api.cc +++ b/lite/api/cxx_api.cc @@ -43,6 +43,7 @@ void Predictor::SaveModel(const std::string &dir, LOG(FATAL) << "Unknown model type"; } if (record_info) { + MkDirRecur(dir); SaveOpKernelInfo(dir); } } diff --git a/lite/core/mir/subgraph/subgraph_pass_test.cc b/lite/core/mir/subgraph/subgraph_pass_test.cc index 252517939990d8ce48083badb342c22fae1459c6..247795a86ce2cbe962b161311f7845622ee3983e 100644 --- a/lite/core/mir/subgraph/subgraph_pass_test.cc +++ b/lite/core/mir/subgraph/subgraph_pass_test.cc @@ -203,7 +203,7 @@ TEST(Subgraph, generate_model_and_check_precision) { valid_places, input_tensor_shape, input_tensor_type, - FLAGS_optimized_model_dir + "/ref_opt_model"); + FLAGS_optimized_model_dir + "_ref_opt_model"); // Generate and run optimized model on NPU/XPU as the target predictor #ifdef LITE_WITH_NPU valid_places.push_back(lite_api::Place{TARGET(kNPU), PRECISION(kFloat)}); @@ -217,7 +217,7 @@ TEST(Subgraph, generate_model_and_check_precision) { valid_places, input_tensor_shape, input_tensor_type, - FLAGS_optimized_model_dir + "/tar_opt_model"); + FLAGS_optimized_model_dir + "_tar_opt_model"); // Check the difference of the output tensors between reference predictor and // target predictor CheckOutputTensors(tar_predictor, ref_predictor, output_tensor_type); diff --git a/lite/model_parser/model_parser.cc b/lite/model_parser/model_parser.cc index 6eaf030928bd9edccf73626e4d085bd24e396081..08e6a303094dc42278bfcb24c54f16bd3819d5c1 100644 --- a/lite/model_parser/model_parser.cc +++ b/lite/model_parser/model_parser.cc @@ -544,7 +544,6 @@ void SaveModelNaive(const std::string &model_dir, const Scope &exec_scope, const cpp::ProgramDesc &cpp_prog, bool combined) { - MkDirRecur(model_dir); // Save program const std::string prog_path = model_dir + ".nb"; naive_buffer::BinaryTable table; @@ -586,7 +585,8 @@ void SaveModelNaive(const std::string &model_dir, // Save Params SaveCombinedParamsNaive(prog_path, exec_scope, cpp_prog); - LOG(INFO) << "Save naive buffer model in '" << model_dir << "' successfully"; + LOG(INFO) << "Save naive buffer model in '" << model_dir + << ".nb' successfully"; } #endif