网络预测时出现错误“First matrix's width must be equal with second matrix's height”
Created by: zds9204
仿照demo设计ctr网络,训练时正常,预测时出现如下错误: Traceback (most recent call last): File "push_ctr_net_fluid_infer.py", line 55, in infer(test_reader, use_cuda=False, model_path=model_path) File "push_ctr_net_fluid_infer.py", line 36, in infer return_numpy=False) File "/home/users/zhangtai01/paddle_release_home/python/lib/python2.7/site-packages/paddle/fluid/executor.py", line 449, in run self.executor.run(program.desc, scope, 0, True, True) paddle.fluid.core.EnforceNotMet: enforce x_mat_dims[1] == y_mat_dims[0] failed, 1 != 5 First matrix's width must be equal with second matrix's height. at [/paddle/paddle/fluid/operators/mul_op.cc:59] PaddlePaddle Call Stacks: 0 0x7fe68e270816p paddle::platform::EnforceNotMet::EnforceNotMet(std::exception_ptr::exception_ptr, char const*, int) + 486 1 0x7fe68e8f7e1ep paddle::operators::MulOp::InferShape(paddle::framework::InferShapeContext*) const + 2494 2 0x7fe68eb0f8f8p paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scope const&, boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace, paddle::platform::CUDAPinnedPlace, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> const&) const + 88 3 0x7fe68eb0cdc0p paddle::framework::OperatorBase::Run(paddle::framework::Scope const&, boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace, paddle::platform::CUDAPinnedPlace, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> const&) + 208 4 0x7fe68e32e05fp paddle::framework::Executor::RunPreparedContext(paddle::framework::ExecutorPrepareContext*, paddle::framework::Scope*, bool, bool, bool) + 255 5 0x7fe68e32f0b0p paddle::framework::Executor::Run(paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool) + 128 6 0x7fe68e2586fdp 7 0x7fe68e281224p pybind11::cpp_function::dispatcher(_object*, _object*, _object*) + 2596 8 0x7fe6b762ebb8p PyEval_EvalFrameEx + 25016 9 0x7fe6b76320bdp PyEval_EvalCodeEx + 2061 10 0x7fe6b762f345p PyEval_EvalFrameEx + 26949 11 0x7fe6b76320bdp PyEval_EvalCodeEx + 2061 12 0x7fe6b762f345p PyEval_EvalFrameEx + 26949 13 0x7fe6b76320bdp PyEval_EvalCodeEx + 2061 14 0x7fe6b76321f2p PyEval_EvalCode + 50 15 0x7fe6b765af42p PyRun_FileExFlags + 146 16 0x7fe6b765c2d9p PyRun_SimpleFileExFlags + 217 17 0x7fe6b767200dp Py_Main + 3149 18 0x7fe6b686fbd5p _libc_start_main + 245 19 0x4007a1p
无论如何修改输入,均产生这种错误。甚至,将输入的lod_tensor故意写成错误的长度,依然出现这种错误。