diff --git a/paddle/fluid/inference/tests/api/CMakeLists.txt b/paddle/fluid/inference/tests/api/CMakeLists.txt index 2b3d26c3960325e60d1f1a03dbc319a825655338..c19d293f094774819b1e2960a2999269c6fa8cb4 100644 --- a/paddle/fluid/inference/tests/api/CMakeLists.txt +++ b/paddle/fluid/inference/tests/api/CMakeLists.txt @@ -86,7 +86,7 @@ inference_analysis_test(test_analyzer_small_dam SRCS analyzer_dam_tester.cc EXTRA_DEPS ${INFERENCE_EXTRA_DEPS} ARGS --infer_model=${DAM_SMALL_INSTALL_DIR}/model --infer_data=${DAM_SMALL_INSTALL_DIR}/data.txt --max_turn_num=1) -# save model +#save model inference_analysis_api_test(test_analyzer_save_model ${DAM_SMALL_INSTALL_DIR} analyzer_save_model_tester.cc) # chinese_ner diff --git a/paddle/fluid/inference/tests/api/analyzer_dam_tester.cc b/paddle/fluid/inference/tests/api/analyzer_dam_tester.cc index a3eac7b200c37b4500183eb3888582d1dc695bb7..cfbb3b15461035c896d9b259147d09a88e934ee6 100644 --- a/paddle/fluid/inference/tests/api/analyzer_dam_tester.cc +++ b/paddle/fluid/inference/tests/api/analyzer_dam_tester.cc @@ -321,7 +321,6 @@ TEST(Analyzer_dam, compare_determine) { CompareDeterministic(reinterpret_cast(&cfg), input_slots_all); } - // Save optim model TEST(Analyzer_dam, save_optim_model) { AnalysisConfig cfg; diff --git a/paddle/fluid/inference/tests/api/analyzer_save_model_tester.cc b/paddle/fluid/inference/tests/api/analyzer_save_model_tester.cc index 578b420ea924754999640925a6b5f3fe524d7668..4d99bbd36ffc90915c5009ef574e3c949a22cb86 100644 --- a/paddle/fluid/inference/tests/api/analyzer_save_model_tester.cc +++ b/paddle/fluid/inference/tests/api/analyzer_save_model_tester.cc @@ -34,7 +34,8 @@ TEST(Analyzer, save_model) { AnalysisConfig cfg; SetConfig(&cfg); cfg.SetModel(FLAGS_infer_model + "/__model__", FLAGS_infer_model + "/param"); - std::string optimModelPath = FLAGS_infer_model + "/saved_optim_model"; + // ensure the path being unique + std::string optimModelPath = FLAGS_infer_model + "/only_for_save_model_test"; mkdir(optimModelPath.c_str(), 0777); SaveOptimModel(&cfg, optimModelPath);