未验证 提交 de26b88b 编写于 作者: J JingZhuangzhuang 提交者: GitHub

params file will not be a nessary file (#38579)

上级 a504ff3f
...@@ -580,9 +580,6 @@ void AnalysisPredictor::PrepareArgument() { ...@@ -580,9 +580,6 @@ void AnalysisPredictor::PrepareArgument() {
if (!config_.model_dir().empty()) { if (!config_.model_dir().empty()) {
argument_.SetModelDir(config_.model_dir()); argument_.SetModelDir(config_.model_dir());
} else { } else {
PADDLE_ENFORCE_EQ(config_.params_file().empty(), false,
platform::errors::PreconditionNotMet(
"Either model_dir or param_file should be set."));
PADDLE_ENFORCE_EQ(config_.prog_file().empty(), false, PADDLE_ENFORCE_EQ(config_.prog_file().empty(), false,
platform::errors::PreconditionNotMet( platform::errors::PreconditionNotMet(
"Either model_dir or prog_file should be set.")); "Either model_dir or prog_file should be set."));
...@@ -1135,7 +1132,7 @@ bool AnalysisPredictor::LoadProgramDesc() { ...@@ -1135,7 +1132,7 @@ bool AnalysisPredictor::LoadProgramDesc() {
std::string filename; std::string filename;
if (!config_.model_dir().empty()) { if (!config_.model_dir().empty()) {
filename = config_.model_dir() + "/__model__"; filename = config_.model_dir() + "/__model__";
} else if (!config_.prog_file().empty() && !config_.params_file().empty()) { } else if (!config_.prog_file().empty()) {
// All parameters are saved in a single file. // All parameters are saved in a single file.
// The file names should be consistent with that used // The file names should be consistent with that used
// in Python API `fluid.io.save_inference_model`. // in Python API `fluid.io.save_inference_model`.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册