03.image_classification运行报错
Created by: zhuziying
EnforceNotMetTraceback (most recent call last) in () 207 # For demo purpose, the training runs on CPU 208 # Please change accordingly. --> 209 main(use_cuda=True)
in main(use_cuda) 199 save_path = "image_classification_resnet.inference.model" 200 --> 201 train(use_cuda=use_cuda, params_dirname=save_path) 202 203 infer(use_cuda=use_cuda, params_dirname=save_path)
in train(use_cuda, params_dirname) 127 [predict], exe) 128 --> 129 train_loop() 130 131
in train_loop() 119 120 avg_cost_test, accuracy_test = train_test( --> 121 test_program, reader=test_reader) 122 print('\nTest with Pass {0}, Loss {1:2.2}, Acc {2:2.2}'.format( 123 pass_id, avg_cost_test, accuracy_test))
in train_test(program, reader) 88 program=program, 89 feed=feeder_test.feed(test_data), ---> 90 fetch_list=[avg_cost, acc]) 91 accumulated = [ 92 x[0] + x[1][0] for x in zip(accumulated, avg_cost_np)
/usr/local/lib/python2.7/dist-packages/paddle/fluid/executor.pyc in run(self, program, feed, fetch_list, feed_var_name, fetch_var_name, scope, return_numpy, use_program_cache) 468 469 self._feed_data(program, feed, feed_var_name, scope) --> 470 self.executor.run(program.desc, scope, 0, True, True) 471 outs = self._fetch_data(fetch_list, fetch_var_name, scope) 472 if return_numpy:
EnforceNotMet: holder_ should not be null Tensor holds no memory. Call Tensor::mutable_data first. at [/paddle/paddle/fluid/framework/tensor.cc:22] PaddlePaddle Call Stacks: 0 0x7f66dc932a12p paddle::platform::EnforceNotMet::EnforceNotMet(std::exception_ptr::exception_ptr, char const*, int) + 482 1 0x7f66ddfb2906p paddle::framework::Tensor::check_memory_size() const + 214 2 0x7f66dc93bb69p float const* paddle::framework::Tensor::data() const + 25 3 0x7f66dd026dcap paddle::operators::BatchNormGradKernel<paddle::platform::CUDADeviceContext, float>::Compute(paddle::framework::ExecutionContext const&) const + 1738 4 0x7f66dd027f30p std::Function_handler<void (paddle::framework::ExecutionContext const&), paddle::framework::OpKernelRegistrarFunctor<paddle::platform::CUDAPlace, false, 0ul, paddle::operators::BatchNormGradKernel<paddle::platform::CUDADeviceContext, float>, paddle::operators::BatchNormGradKernel<paddle::platform::CUDADeviceContext, double>, paddle::operators::BatchNormGradKernel<paddle::platform::CUDADeviceContext, paddle::platform::float16> >::operator()(char const*, char const*) const::{lambda(paddle::framework::ExecutionContext const&)#1}>::M_invoke(std::Any_data const&, paddle::framework::ExecutionContext const&) + 32 5 0x7f66ddf3e85ap 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 + 506 6 0x7f66ddf3ad3fp 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&) + 447 7 0x7f66dc9f8957p paddle::framework::Executor::RunPreparedContext(paddle::framework::ExecutorPrepareContext*, paddle::framework::Scope*, bool, bool, bool) + 247 8 0x7f66dc9f9635p paddle::framework::Executor::Run(paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool) + 117 9 0x7f66dc91775ap 10 0x7f66dc948212p pybind11::cpp_function::dispatcher(_object*, _object*, _object*) + 2338 11 0x4c5326p PyEval_EvalFrameEx + 37958 12 0x4b9b66p PyEval_EvalCodeEx + 774 13 0x4c17c6p PyEval_EvalFrameEx + 22758 14 0x4b9b66p PyEval_EvalCodeEx + 774 15 0x4c1f56p PyEval_EvalFrameEx + 24694 16 0x4b9b66p PyEval_EvalCodeEx + 774 17 0x4c1f56p PyEval_EvalFrameEx + 24694 18 0x4b9b66p PyEval_EvalCodeEx + 774 19 0x4c1f56p PyEval_EvalFrameEx + 24694 20 0x4b9b66p PyEval_EvalCodeEx + 774 21 0x4c1f56p PyEval_EvalFrameEx + 24694 22 0x4b9b66p PyEval_EvalCodeEx + 774 23 0x4bf7a2p PyEval_EvalFrameEx + 14530 24 0x4b9b66p PyEval_EvalCodeEx + 774 25 0x4c17c6p PyEval_EvalFrameEx + 22758 26 0x4b9b66p PyEval_EvalCodeEx + 774 27 0x4c17c6p PyEval_EvalFrameEx + 22758 28 0x4b9b66p PyEval_EvalCodeEx + 774 29 0x4d57a3p 30 0x4a587ep PyObject_Call + 62 31 0x4be51ep PyEval_EvalFrameEx + 9790 32 0x4b9b66p PyEval_EvalCodeEx + 774 33 0x4c1f56p PyEval_EvalFrameEx + 24694 34 0x4b9b66p PyEval_EvalCodeEx + 774 35 0x4c17c6p PyEval_EvalFrameEx + 22758 36 0x4b9b66p PyEval_EvalCodeEx + 774 37 0x4c1f56p PyEval_EvalFrameEx + 24694 38 0x4b9b66p PyEval_EvalCodeEx + 774 39 0x4c1f56p PyEval_EvalFrameEx + 24694 40 0x4b9b66p PyEval_EvalCodeEx + 774 41 0x4d57a3p 42 0x4a587ep PyObject_Call + 62 43 0x4be51ep PyEval_EvalFrameEx + 9790 44 0x4b9b66p PyEval_EvalCodeEx + 774 45 0x4d57a3p 46 0x4a587ep PyObject_Call + 62 47 0x4be51ep PyEval_EvalFrameEx + 9790 48 0x4b9b66p PyEval_EvalCodeEx + 774 49 0x4c1f56p PyEval_EvalFrameEx + 24694 50 0x4b9b66p PyEval_EvalCodeEx + 774 51 0x4c1f56p PyEval_EvalFrameEx + 24694 52 0x4b9b66p PyEval_EvalCodeEx + 774 53 0x4d57a3p 54 0x4a587ep PyObject_Call + 62 55 0x4be51ep PyEval_EvalFrameEx + 9790 56 0x4b9b66p PyEval_EvalCodeEx + 774 57 0x4c1f56p PyEval_EvalFrameEx + 24694 58 0x4b9b66p PyEval_EvalCodeEx + 774 59 0x4c1f56p PyEval_EvalFrameEx + 24694 60 0x4b9b66p PyEval_EvalCodeEx + 774 61 0x4c1f56p PyEval_EvalFrameEx + 24694 62 0x4b9b66p PyEval_EvalCodeEx + 774 63 0x4c17c6p PyEval_EvalFrameEx + 22758 64 0x4b9b66p PyEval_EvalCodeEx + 774 65 0x4bf7a2p PyEval_EvalFrameEx + 14530 66 0x4b9b66p PyEval_EvalCodeEx + 774 67 0x4c17c6p PyEval_EvalFrameEx + 22758 68 0x4b9b66p PyEval_EvalCodeEx + 774 69 0x4d5669p 70 0x4a587ep PyObject_Call + 62 71 0x51a866p 72 0x4939ccp Py_Main + 1612 73 0x7f67281c4830p __libc_start_main + 240 74 0x493299p _start + 41