paddle.fluid.core.EnforceNotMet: Enforce failed. Expected x_dims[i + axis] == y_dims[i], but received x_dims[i + axis]:1 != y_dims[i]:72.
Created by: thelongestmovie
pytorch模型能够转paddle,paddle运行的时候遇到错误。网络用到了SENet的 x * sigmoid(x_squeeze).其中: x.shape=(1,128,72,128) x_squeeze.shape=(1,128,1,1) 在pytorch当中能够运行,paddle当中报如下错误 报错完整信息: File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/executor.py", line 591, in run exe.run(program.desc, scope, 0, True, True) paddle.fluid.core.EnforceNotMet: Enforce failed. Expected x_dims[i + axis] == y_dims[i], but received x_dims[i + axis]:1 != y_dims[i]:72. Broadcast dimension mismatch. at [/home/jianwang/test/paddle/Paddle-dev/Paddle/paddle/fluid/operators/elementwise/elementwise_op_function.h:63] PaddlePaddle Call Stacks: 0 0x7ff16e64cc5dp void paddle::platform::EnforceNotMet::Init<std::cxx11::basic_string<char, std::char_traits, std::allocator > >(std::cxx11::basic_string<char, std::char_traits, std::allocator >, char const*, int) + 509 1 0x7ff16e64df32p paddle::platform::EnforceNotMet::EnforceNotMet<char const*, char const*, char const*, char const*, std::cxx11::basic_string<char, std::char_traits, std::allocator >, char const*, std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::cxx11::basic_string<char, std::char_traits, std::allocator > >(char const*, int, char const*, char const*, char const*, char const*, std::cxx11::basic_string<char, std::char_traits, std::allocator >, char const*, std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::cxx11::basic_string<char, std::char_traits, std::allocator >) + 162 2 0x7ff16eb98e02p paddle::operators::get_mid_dims(paddle::framework::DDim const&, paddle::framework::DDim const&, int, int*, int*, int*) + 418 3 0x7ff16eb9ef8dp void paddle::operators::ElementwiseComputeEx<paddle::operators::MulFunctor, paddle::platform::CPUDeviceContext, float, float>(paddle::framework::ExecutionContext const&, paddle::framework::Tensor const*, paddle::framework::Tensor const*, int, paddle::operators::MulFunctor, paddle::framework::Tensor*) + 1197 4 0x7ff16fa64684p paddle::operators::ElementwiseMulKernel<paddle::platform::CPUDeviceContext, float>::Compute(paddle::framework::ExecutionContext const&) const + 644 5 0x7ff16fa64b3fp std::Function_handler<void (paddle::framework::ExecutionContext const&), paddle::framework::OpKernelRegistrarFunctor<paddle::platform::CPUPlace, false, 0ul, paddle::operators::ElementwiseMulKernel<paddle::platform::CPUDeviceContext, float>, paddle::operators::ElementwiseMulKernel<paddle::platform::CPUDeviceContext, double>, paddle::operators::ElementwiseMulKernel<paddle::platform::CPUDeviceContext, int>, paddle::operators::ElementwiseMulKernel<paddle::platform::CPUDeviceContext, long> >::operator()(char const*, char const*, int) const::{lambda(paddle::framework::ExecutionContext const&)#1 (closed)}>::M_invoke(std::Any_data const&, paddle::framework::ExecutionContext const&) + 47 6 0x7ff16ff3b500p 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 + 656 7 0x7ff16ff35aadp 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&) + 317 8 0x7ff16e791f0ep paddle::framework::Executor::RunPreparedContext(paddle::framework::ExecutorPrepareContext*, paddle::framework::Scope*, bool, bool, bool) + 302 9 0x7ff16e79453ap paddle::framework::Executor::Run(paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool) + 218 10 0x7ff16e61ff18p 11 0x7ff16e678aedp 12 0x4c5326p PyEval_EvalFrameEx + 37958 13 0x4b9b66p PyEval_EvalCodeEx + 774 14 0x4c1f56p PyEval_EvalFrameEx + 24694 15 0x4b9b66p PyEval_EvalCodeEx + 774 16 0x4c17c6p PyEval_EvalFrameEx + 22758 17 0x4c141fp PyEval_EvalFrameEx + 21823 18 0x4b9b66p PyEval_EvalCodeEx + 774 19 0x4eb69fp 20 0x4e58f2p PyRun_FileExFlags + 130 21 0x54aae7p 22 0x4c1e1ep PyEval_EvalFrameEx + 24382 23 0x4b9b66p PyEval_EvalCodeEx + 774 24 0x4c17c6p PyEval_EvalFrameEx + 22758 25 0x4c141fp PyEval_EvalFrameEx + 21823 26 0x4b9b66p PyEval_EvalCodeEx + 774 27 0x4eb69fp 28 0x4e58f2p PyRun_FileExFlags + 130 29 0x4e41a6p PyRun_SimpleFileExFlags + 390 30 0x4938cep Py_Main + 1358 31 0x7ff1de44c830p __libc_start_main + 240 32 0x493299p _start + 41