使用fluid c++ api预测book中训练出来的模型出错
Created by: wuyan08
通过book/01.fit_a_line/train.py训练出模型,使用fluid c++ api进行预测时,会报找不到__model__的错误。执行train.py后确实没有生成__model__文件,只生成了fc_0.b_0、fc_0.w_0、learning_rate_0、mean_0.tmp_0@GRAD这四个文件。
预测时的错误日志: terminate called after throwing an instance of 'paddle::platform::EnforceNotMet' what(): Cannot open file ./data/model/paddle/fluid/fit_a_line/model at [/home/paddlepaddle/Paddle/paddle/fluid/inference/io.cc:49] PaddlePaddle Call Stacks: 0 0x7f0c6ed73edap paddle::platform::EnforceNotMet::EnforceNotMet(std::__exception_ptr::exception_ptr, char const*, int) + 634 1 0x7f0c6ed6efe2p paddle::inference::ReadBinaryFile(std::string const&, std::string*) + 818 2 0x7f0c6ed710e7p paddle::inference::Load(paddle::framework::Executor*, paddle::framework::Scope*, std::string const&) + 215 3 0x7f0c6e43f92bp paddle::NativePaddlePredictor::Init(std::shared_ptrpaddle::framework::Scope) + 843 4 0x7f0c6e44069ap std::unique_ptr<paddle::PaddlePredictor, std::default_deletepaddle::PaddlePredictor > paddle::CreatePaddlePredictor<paddle::NativeConfig, (paddle::PaddleEngineKind)0>(paddle::NativeConfig const&) + 1802