uwsgi部署推理模型请求频繁或者并发程序报错、内存也泄露
Created by: L-lei
请求频繁或者并发请求出现问题 问题1:程序推理时报错 问题2:内存会一直增大 python版本3.6 paddlepaddle版本1.8.4 推理主要部分 infer_scope = fluid.core.Scope() with fluid.scope_guard(infer_scope): exe = fluid.Executor(place) program, feed_names, fetch_targets = fluid.io.load_inference_model() exe.run(program,feed=inputs,fetch_list=fecth_targets,return_numpy=False)
报错内容
Error Message Summary:
Error: Tensor not initialized yet when Tensor::type() is called. [Hint: holder_ should not be null.] at (/paddle/paddle/fluid/framework/tensor.h:140) [operator < conv2d > error]
File "./utils/obj_infer.py", line 442, in predict return_numpy=False) File "/usr/local/lib64/python3.6/site-packages/paddle/fluid/executor.py", line 1071, in run six.reraise(*sys.exc_info()) File "/usr/local/lib/python3.6/site-packages/six.py", line 703, in reraise raise value File "/usr/local/lib64/python3.6/site-packages/paddle/fluid/executor.py", line 1066, in run return_merged=return_merged) File "/usr/local/lib64/python3.6/site-packages/paddle/fluid/executor.py", line 1154, in _run_impl use_program_cache=use_program_cache) File "/usr/local/lib64/python3.6/site-packages/paddle/fluid/executor.py", line 1229, in _run_program fetch_var_name) paddle.fluid.core_avx.EnforceNotMet:
C++ Call Stacks (More useful to developers):
0 std::string paddle::platform::GetTraceBackString<std::string const&>(std::string const&, char const*, int) 1 paddle::platform::EnforceNotMet::EnforceNotMet(std::string const&, char const*, int) 2 paddle::framework::Tensor::type() const 3 paddle::operators::ConvOp::GetExpectedKernelType(paddle::framework::ExecutionContext const&) const 4 paddle::framework::OperatorWithKernel::ChooseKernel(paddle::framework::RuntimeContext const&, paddle::framework::Scope const&, paddle::platform::Place const&) const 5 paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scope const&, paddle::platform::Place const&, paddle::framework::RuntimeContext*) const 6 paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scope const&, paddle::platform::Place const&) const 7 paddle::framework::OperatorBase::Run(paddle::framework::Scope const&, paddle::platform::Place const&) 8 paddle::framework::Executor::RunPartialPreparedContext(paddle::framework::ExecutorPrepareContext*, paddle::framework::Scope*, long, long, bool, bool, bool) 9 paddle::framework::Executor::RunPreparedContext(paddle::framework::ExecutorPrepareContext*, paddle::framework::Scope*, bool, bool, bool) 10 paddle::framework::Executor::Run(paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool, std::vector<std::string, std::allocatorstd::string > const&, bool, bool)