错误:paddle.fluid.core_avx.EnforceNotMet: Axis should be in range [0, x_dims)
已关闭
错误:paddle.fluid.core_avx.EnforceNotMet: Axis should be in range [0, x_dims)
Created by: Tanzichang
在使用pytorch转paddle模型是,elementwise_multiplication操作报错。具体是自己将pytorch先转为onnx, onnx转为paddle, 在预测阶段使用 fluid.Executor( fluid.CPUPlace() ).run( *** )函数做预测的时候就会报错。
版本信息:PaddlePaddle version: 1.5.1, Python version: 3.6.7
还麻烦帮忙解决一下。谢谢。
报错具体信息如下: Traceback (most recent call last): File "paddle_predict.py", line 74, in fetch_list=fetch_targets) File "/usr/local/lib/python3.6/dist-packages/paddle/fluid/executor.py", line 651, in run use_program_cache=use_program_cache) File "/usr/local/lib/python3.6/dist-packages/paddle/fluid/executor.py", line 749, in run exe.run(program.desc, scope, 0, True, True, fetch_var_name) paddle.fluid.core_avx.EnforceNotMet: Axis should be in range [0, x_dims) at [/paddle/paddle/fluid/operators/elementwise/elementwise_op_function.h:680] PaddlePaddle Call Stacks: 0 0x7f215add2f10p void paddle::platform::EnforceNotMet::Init<char const*>(char const*, char const*, int) + 352 1 0x7f215add3289p paddle::platform::EnforceNotMet::EnforceNotMet(std::exception_ptr::exception_ptr, char const*, int) + 137 2 0x7f215c664d43p void paddle::operators::ElementwiseComputeEx<paddle::operators::DivFunctor, paddle::platform::CPUDeviceContext, float, float>(paddle::framework::ExecutionContext const&, paddle::framework::Tensor const*, paddle::framework::Tensor const*, int, paddle::operators::DivFunctor, paddle::framework::Tensor*) + 1571 3 0x7f215c665026p paddle::operators::ElementwiseDivKernel<paddle::platform::CPUDeviceContext, float>::Compute(paddle::framework::ExecutionContext const&) const + 454 4 0x7f215c6655d3p std::Function_handler<void (paddle::framework::ExecutionContext const&), paddle::framework::OpKernelRegistrarFunctor<paddle::platform::CPUPlace, false, 0ul, paddle::operators::ElementwiseDivKernel<paddle::platform::CPUDeviceContext, float>, paddle::operators::ElementwiseDivKernel<paddle::platform::CPUDeviceContext, double>, paddle::operators::ElementwiseDivKernel<paddle::platform::CPUDeviceContext, int>, paddle::operators::ElementwiseDivKernel<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&) + 35 5 0x7f215ce521e7p 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&, paddle::framework::RuntimeContext*) const + 375 6 0x7f215ce525c1p 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 + 529 7 0x7f215ce4fbbcp 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&) + 332 8 0x7f215af5dd0ep paddle::framework::Executor::RunPreparedContext(paddle::framework::ExecutorPrepareContext*, paddle::framework::Scope*, bool, bool, bool) + 382 9 0x7f215af60dafp paddle::framework::Executor::Run(paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool, std::vector<std::string, std::allocatorstd::string > const&, bool) + 143 10 0x7f215adc459dp 11 0x7f215ae05826p 12 0x566ad8p _PyCFunction_FastCallDict + 648 13 0x5067b0p 14 0x50729ep _PyEval_EvalFrameDefault + 1246 15 0x504232p 16 0x505e83p 17 0x5066f0p 18 0x508386p _PyEval_EvalFrameDefault + 5574 19 0x504232p 20 0x505e83p 21 0x5066f0p 22 0x508386p _PyEval_EvalFrameDefault + 5574 23 0x504232p 24 0x6022e3p PyEval_EvalCode + 35 25 0x647fa2p 26 0x64806ap PyRun_FileExFlags + 154 27 0x649d97p PyRun_SimpleFileExFlags + 407 28 0x63c352p Py_Main + 1474 29 0x4dbcb9p main + 233 30 0x7f21cebd7830p __libc_start_main + 240 31 0x5cb639p _start + 41