holder_ should not be null
Created by: 1286667673
您好:我用训练好的模型预测的时候报这样的错误,是为什么呢? 38 feed={feed_target_names[0]: test_im}, #喂入要预测的img 39 ---> 40 fetch_list=fetch_targets) #得到推测结果 41 42 /opt/conda/lib/python3.6/site-packages/paddle/fluid/executor.py in run(self, program, feed, fetch_list, feed_var_name, fetch_var_name, scope, return_numpy, use_program_cache) 563 scope=scope, 564 return_numpy=return_numpy, --> 565 use_program_cache=use_program_cache) 566 else: 567 if fetch_list and program.is_data_parallel and program.program and ( /opt/conda/lib/python3.6/site-packages/paddle/fluid/executor.py in run(self, program, exe, feed, fetch_list, feed_var_name, fetch_var_name, scope, return_numpy, use_program_cache) 640 641 self.feed_data(program, feed, feed_var_name, scope) --> 642 exe.run(program.desc, scope, 0, True, True, fetch_var_name) 643 outs = self.fetch_data(fetch_list, fetch_var_name, scope) 644 if return_numpy: EnforceNotMet: Invoke operator elementwise_sub error. Python Callstacks: File "/opt/conda/lib/python3.6/site-packages/paddle/fluid/framework.py", line 1654, in append_op attrs=kwargs.get("attrs", None)) File "/opt/conda/lib/python3.6/site-packages/paddle/fluid/layer_helper.py", line 43, in append_op return self.main_program.current_block().append_op(*args, **kwargs) File "/opt/conda/lib/python3.6/site-packages/paddle/fluid/layers/nn.py", line 1580, in square_error_cost outputs={'Out': [minus_out]}) File "", line 1, in squar = fluid.layers.square_error_cost(input=predict, label=label) File "/opt/conda/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2910, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "/opt/conda/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2850, in run_ast_nodes if self.run_code(code, result): File "/opt/conda/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2728, in run_cell interactivity=interactivity, compiler=compiler, result=result) File "/opt/conda/lib/python3.6/site-packages/ipykernel/zmqshell.py", line 533, in run_cell return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs) File "/opt/conda/lib/python3.6/site-packages/ipykernel/ipkernel.py", line 208, in do_execute res = shell.run_cell(code, store_history=store_history, silent=silent) File "/opt/conda/lib/python3.6/site-packages/ipykernel/kernelbase.py", line 397, in execute_request user_expressions, allow_stdin) File "/opt/conda/lib/python3.6/site-packages/ipykernel/kernelbase.py", line 232, in dispatch_shell handler(stream, idents, msg) File "/opt/conda/lib/python3.6/site-packages/ipykernel/kernelbase.py", line 281, in dispatcher return self.dispatch_shell(stream, msg) File "/opt/conda/lib/python3.6/site-packages/tornado/stack_context.py", line 277, in null_wrapper return fn(*args, kwargs) File "/opt/conda/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 438, in _run_callback callback(args, kwargs) File "/opt/conda/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 486, in _handle_recv self._run_callback(callback, msg) File "/opt/conda/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 456, in _handle_events self._handle_recv() File "/opt/conda/lib/python3.6/site-packages/tornado/stack_context.py", line 277, in null_wrapper return fn(args, kwargs) File "/opt/conda/lib/python3.6/site-packages/tornado/ioloop.py", line 888, in start handler_func(fd_obj, events) File "/opt/conda/lib/python3.6/site-packages/ipykernel/kernelapp.py", line 478, in start self.io_loop.start() File "/opt/conda/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance app.start() File "/opt/conda/lib/python3.6/site-packages/ipykernel_launcher.py", line 16, in app.launch_new_instance() File "/opt/conda/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/opt/conda/lib/python3.6/runpy.py", line 193, in run_module_as_main "main", mod_spec) C++ Callstacks: holder should not be null Tensor holds no memory. Call Tensor::mutable_data first. at [/paddle/paddle/fluid/framework/tensor.cc:23] PaddlePaddle Call Stacks: 0 0x7fc694130228p void paddle::platform::EnforceNotMet::Initstd::string(std::string, char const, int) + 360 1 0x7fc694130577p paddle::platform::EnforceNotMet::EnforceNotMet(std::string const&, char const, int) + 87 2 0x7fc695e13179p paddle::framework::Tensor::check_memory_size() const + 185 3 0x7fc6941375e9p float const paddle::framework::Tensor::data() const + 25 4 0x7fc69575214cp void paddle::operators::ElementwiseComputeEx<paddle::operators::SubFunctor, paddle::platform::CUDADeviceContext, float, float>(paddle::framework::ExecutionContext const&, paddle::framework::Tensor const, paddle::framework::Tensor const, int, paddle::operators::SubFunctor, paddle::framework::Tensor) + 76 5 0x7fc695752bb9p paddle::operators::ElementwiseSubKernel<paddle::platform::CUDADeviceContext, float>::Compute(paddle::framework::ExecutionContext const&) const + 457 6 0x7fc695753163p std::_Function_handler<void (paddle::framework::ExecutionContext const&), paddle::framework::OpKernelRegistrarFunctor<paddle::platform::CUDAPlace, false, 0ul, paddle::operators::ElementwiseSubKernel<paddle::platform::CUDADeviceContext, float>, paddle::operators::ElementwiseSubKernel<paddle::platform::CUDADeviceContext, paddle::platform::float16>, paddle::operators::ElementwiseSubKernel<paddle::platform::CUDADeviceContext, double>, paddle::operators::ElementwiseSubKernel<paddle::platform::CUDADeviceContext, int>, paddle::operators::ElementwiseSubKernel<paddle::platform::CUDADeviceContext, 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 7 0x7fc695dbf376p 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 + 662 8 0x7fc695dbfae4p 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 + 292 9 0x7fc695dbd40cp 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 10 0x7fc6942a23fep paddle::framework::Executor::RunPreparedContext(paddle::framework::ExecutorPrepareContext*, paddle::framework::Scope*, bool, bool, bool) + 382 11 0x7fc6942a323fp paddle::framework::Executor::Run(paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool, std::vector<std::string, std::allocatorstd::string > const&, bool) + 143 12 0x7fc69411f8dep 13 0x7fc6941627cep 14 0x55d92f511744p _PyCFunction_FastCallDict + 340 15 0x55d92f59857ep 16 0x55d92f5bd38ap _PyEval_EvalFrameDefault + 778 17 0x55d92f5918e4p 18 0x55d92f592771p 19 0x55d92f598505p 20 0x55d92f5be147p _PyEval_EvalFrameDefault + 4295 21 0x55d92f5918e4p 22 0x55d92f592771p 23 0x55d92f598505p 24 0x55d92f5be147p _PyEval_EvalFrameDefault + 4295 25 0x55d92f593289p PyEval_EvalCodeEx + 809 26 0x55d92f59401cp PyEval_EvalCode + 28 27 0x55d92f5bad97p 28 0x55d92f511681p _PyCFunction_FastCallDict + 145 29 0x55d92f59842cp 30 0x55d92f5bd38ap _PyEval_EvalFrameDefault + 778 31 0x55d92f5918e4p 32 0x55d92f592771p 33 0x55d92f598505p 34 0x55d92f5bd38ap _PyEval_EvalFrameDefault + 778 35 0x55d92f5918e4p 36 0x55d92f592771p 37 0x55d92f598505p 38 0x55d92f5be147p _PyEval_EvalFrameDefault + 4295 39 0x55d92f591bfep 40 0x55d92f592e6ap _PyFunction_FastCallDict + 986 41 0x55d92f511b0fp _PyObject_FastCallDict + 623 42 0x55d92f5166a3p _PyObject_Call_Prepend + 99 43 0x55d92f51154ep PyObject_Call + 62 44 0x55d92f5bea6cp _PyEval_EvalFrameDefault + 6636 45 0x55d92f591a76p 46 0x55d92f592771p 47 0x55d92f598505p 48 0x55d92f5be147p _PyEval_EvalFrameDefault + 4295 49 0x55d92f5918e4p 50 0x55d92f592771p 51 0x55d92f598505p 52 0x55d92f5bd38ap _PyEval_EvalFrameDefault + 778 53 0x55d92f59253bp 54 0x55d92f598505p 55 0x55d92f5bd38ap _PyEval_EvalFrameDefault + 778 56 0x55d92f59253bp 57 0x55d92f598505p 58 0x55d92f5bd38ap _PyEval_EvalFrameDefault + 778 59 0x55d92f5938c6p PyEval_EvalCodeEx + 2406 60 0x55d92f5941a6p 61 0x55d92f51154ep PyObject_Call + 62 62 0x55d92f5bea6cp _PyEval_EvalFrameDefault + 6636 63 0x55d92f5938c6p PyEval_EvalCodeEx + 2406 64 0x55d92f5941a6p 65 0x55d92f51154ep PyObject_Call + 62 66 0x55d92f5bea6cp _PyEval_EvalFrameDefault + 6636 67 0x55d92f5918e4p 68 0x55d92f592771p 69 0x55d92f598505p 70 0x55d92f5bd38ap _PyEval_EvalFrameDefault + 778 71 0x55d92f59253bp 72 0x55d92f598505p 73 0x55d92f5bd38ap _PyEval_EvalFrameDefault + 778 74 0x55d92f592babp _PyFunction_FastCallDict + 283 75 0x55d92f511b0fp _PyObject_FastCallDict + 623 76 0x55d92f5166a3p _PyObject_Call_Prepend + 99 77 0x55d92f51154ep PyObject_Call + 62 78 0x55d92f5bea6cp _PyEval_EvalFrameDefault + 6636 79 0x55d92f591bfep 80 0x55d92f592771p 81 0x55d92f598505p 82 0x55d92f5bd38ap _PyEval_EvalFrameDefault + 778 83 0x55d92f59253bp 84 0x55d92f598505p 85 0x55d92f5bd38ap _PyEval_EvalFrameDefault + 778 86 0x55d92f59253bp 87 0x55d92f598505p 88 0x55d92f5bd38ap _PyEval_EvalFrameDefault + 778 89 0x55d92f5918e4p 90 0x55d92f592771p 91 0x55d92f598505p 92 0x55d92f5bd38ap _PyEval_EvalFrameDefault + 778 93 0x55d92f593289p PyEval_EvalCodeEx + 809 94 0x55d92f59401cp PyEval_EvalCode + 28 95 0x55d92f5bad97p 96 0x55d92f511681p _PyCFunction_FastCallDict + 145 97 0x55d92f59842cp 98 0x55d92f5bd38ap _PyEval_EvalFrameDefault + 778 99 0x55d92f5918e4p