fluid训练的模型v2预测,header.size==getSize()出错
Created by: menghou
模型训练:fluid 版本1.3.0 环境 cpu python2.7 模型预测:paddle-0.8.0b3.dist
错误信息:
[WARNING 2019-05-13 19:59:32,275 networks.py:1438]
outputs routine try to calculate network's inputs and outputs order. It might not work well.Please see follow log carefully. [INFO 2019-05-13 19:59:32,281 networks.py:1466] The input order is ... [INFO 2019-05-13 19:59:32,281 networks.py:1472] The output order is [output, output2, __concat_5__, __concat_2__] I0513 19:59:32.496774 37131 GradientMachine.cpp:123] Loading parameters from data_online/model F0513 19:59:32.551892 37131 Parameter.cpp:377] Check failed: header.size == getSize() (1532928 vs. 1471488) The size (1532928) in the file does not match the size (1471488) of the parameter: _fc1.w0 *** Check failure stack trace: *** @ 0x7f3304aa1c68 google::LogMessage::Fail() @ 0x7f3304aa1bc0 google::LogMessage::SendToLog() @ 0x7f3304aa1655 google::LogMessage::Flush() @ 0x7f3304aa4416 google::LogMessageFatal::~LogMessageFatal() @ 0x7f330426515f paddle::Parameter::load() @ 0x7f330426584d paddle::Parameter::load() @ 0x7f330420a79a paddle::GradientMachine::loadParameters() @ 0x7f33040e99c8 _wrap_GradientMachine_loadParameters @ 0x4b4cb9 PyEval_EvalFrameEx @ 0x4b6b28 PyEval_EvalCodeEx @ 0x4b5d10 PyEval_EvalFrameEx @ 0x4b6b28 PyEval_EvalCodeEx @ 0x529340 function_call @ 0x422cba PyObject_Call @ 0x4271ad instancemethod_call @ 0x422cba PyObject_Call @ 0x48121f slot_tp_init @ 0x47eb1a type_call @ 0x422cba PyObject_Call @ 0x4b31dd PyEval_EvalFrameEx @ 0x4b5fb8 PyEval_EvalFrameEx @ 0x4b6b28 PyEval_EvalCodeEx @ 0x4b6c52 PyEval_EvalCode @ 0x4e1c7d PyRun_FileExFlags @ 0x4e3501 PyRun_SimpleFileExFlags @ 0x4159dd Py_Main @ 0x7f330bf41bd5 __libc_start_main @ 0x414b71 (unknown)
训练模型结构:
E_AgeId = word_emb(age, AGE_SIZE, 8) E_GenderId = word_emb(gender, GENDER_SIZE, 8) E_MultiPreqIds = text_cnn(preq_ids) E_QueryProfile = text_cnn(query_profile_ids) E_WordProfile = text_cnn(click_word_profile_ids)
预测部分代码:
conf = parse_config(train_conf, "is_predict=1") self.network = swig_paddle.GradientMachine.createFromConfigProto(conf.model_config) self.network.loadParameters(self.model_dir)
预测模型结构:
`def deepctr_net(input_dim, class_dim=2, emb_dim=64, fea_dim=128, is_predict=False):
E_AgeId = embedding_layer(input=data_layer("AgeId", 9), size=8)
E_GenderId = embedding_layer(input=data_layer("GenderId", 3), size=8)
embedding2 = embedding_layer(input=data_layer("MultiPreqIds", input_dim), size=emb_dim)
E_MultiPreqIds = text_conv_pool(input=embedding2, context_len=5, hidden_size=fea_dim)
embedding3 = embedding_layer(input=data_layer("QueryProfile", input_dim), \
size=emb_dim) #, \
E_QueryProfile = text_conv_pool(input=embedding3, context_len=5, hidden_size=fea_dim)
embedding4 = embedding_layer(input=data_layer("WordProfile", input_dim), \
size=emb_dim) #, \
E_WordProfile = text_conv_pool(input=embedding4, context_len=5, hidden_size=fea_dim)`