From daf88968e258b77edf7348f1f741daf67297ec82 Mon Sep 17 00:00:00 2001 From: lijianshe02 <48898730+lijianshe02@users.noreply.github.com> Date: Wed, 22 May 2019 19:48:09 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bug=20that=20saved=20optimal=20model=20pa?= =?UTF-8?q?th=20in=20test=5Fanalyzer=5Fsave=5Fmodel=20con=E2=80=A6=20(#175?= =?UTF-8?q?55)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * modify saved model path in analyzer_save_model.cc test=develop --- paddle/fluid/inference/tests/api/CMakeLists.txt | 2 +- paddle/fluid/inference/tests/api/analyzer_dam_tester.cc | 1 - paddle/fluid/inference/tests/api/analyzer_save_model_tester.cc | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/inference/tests/api/CMakeLists.txt b/paddle/fluid/inference/tests/api/CMakeLists.txt index 2b3d26c3960..c19d293f094 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 a3eac7b200c..cfbb3b15461 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 578b420ea92..4d99bbd36ff 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); -- GitLab