fix bug that saved optimal model path in test_analyzer_save_model con… (#17555)

* modify saved model path in analyzer_save_model.cc test=develop
fix_ema
lijianshe02 6 years ago committed by GitHub
parent 43d15b9d96
commit daf88968e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

@ -321,7 +321,6 @@ TEST(Analyzer_dam, compare_determine) {
CompareDeterministic(reinterpret_cast<const PaddlePredictor::Config *>(&cfg),
input_slots_all);
}
// Save optim model
TEST(Analyzer_dam, save_optim_model) {
AnalysisConfig cfg;

@ -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);

Loading…
Cancel
Save