PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
https://paddlepaddle.github.io/PaddleOCR/
Apache License 2.0
43.02k stars 7.72k forks source link

PaddleOCR seg faults #11593

Closed umayrh closed 7 months ago

umayrh commented 7 months ago

Hi. While processing a bunch of JPEGs using PaddleOCR, I occasionally encounter a mysterious seg fault. I haven't yet looked into the image being read before the crash, but wonder if the error message might help figure out what's going on.

NB. Seems like the seg fault goes away if I set use_angle_cls=False.

请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem

Linux 6.5.0-15-generic #15~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 12 18:54:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linux. Python 3.11.7.

paddlepaddle==2.6.0
paddleocr==2.7.0.3
text_det = paddleocr.PaddleOCR(lang="en", use_gpu=False, use_angle_cls=True)
doc_text = text_det.ocr(jpeg_image_path)

There there multiple paddleocr.PaddleOCR() instances being created, each by a different thread spawned by Flask-APScheduler's BackgroundScheduler (https://apscheduler.readthedocs.io/en/3.x/modules/schedulers/background.html).

 umayr-home bash[36696]: [2024/02/17 16:32:16] ppocr DEBUG: dt_boxes num : 49, elapsed : 0.15033006
66809082
 16:32:16 umayr-home bash[36696]: [2024/02/17 16:32:16] ppocr DEBUG: dt_boxes num : 89, elapsed : 0.16058468
81866455
 16:32:16 umayr-home bash[36696]: [2024/02/17 16:32:16] ppocr DEBUG: cls num  : 49, elapsed : 0.111751317977
90527
 16:32:16 umayr-home bash[36696]: --------------------------------------
 16:32:16 umayr-home bash[36696]: C++ Traceback (most recent call last):
 16:32:16 umayr-home bash[36696]: --------------------------------------
 16:32:16 umayr-home bash[36696]: 0   paddle::AnalysisPredictor::ZeroCopyRun()
 16:32:16 umayr-home bash[36696]: 1   paddle::framework::NaiveExecutor::Run()
 16:32:16 umayr-home bash[36696]: 2   paddle::framework::OperatorBase::Run(paddle::framework::Scope const&, 
phi::Place const&)
 16:32:16 umayr-home bash[36696]: 3   paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scop
e const&, phi::Place const&) const
 16:32:16 umayr-home bash[36696]: 4   paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scop
e const&, phi::Place const&, paddle::framework::RuntimeContext*) const
 16:32:16 umayr-home bash[36696]: 5   void phi::KernelImpl<void (*)(phi::OneDNNContext const&, phi::DenseTen
sor const&, phi::DenseTensor const&, paddle::optional<phi::DenseTensor> const&, paddle::optional<phi::DenseTensor> c
onst&, std::vector<int, std::allocator<int> > const&, std::vector<int, std::allocator<int> > const&, std::string con
st&, std::vector<int, std::allocator<int> > const&, int, std::string const&, std::string const&, std::string const&,
 bool, bool, phi::DenseTensor*), &(void phi::fusion::FusedConv2DKernel<float, phi::OneDNNContext>(phi::OneDNNContext
 const&, phi::DenseTensor const&, phi::DenseTensor const&, paddle::optional<phi::DenseTensor> const&, paddle::option
al<phi::DenseTensor> const&, std::vector<int, std::allocator<int> > const&, std::vector<int, std::allocator<int> > c
onst&, std::string const&, std::vector<int, std::allocator<int> > const&, int, std::string const&, std::string const
&, std::string const&, bool, bool, phi::DenseTensor*))>::KernelCallHelper<paddle::optional<phi::DenseTensor> const&, paddle::optional<phi::DenseTensor> const&, std::vector<int, std::allocator<int> > const&, std::vector<int, std::allocator<int> > const&, std::string const&, std::vector<int, std::allocator<int> > const&, int, std::string const&, std::string const&, std::string const&, bool, bool, phi::DenseTensor*, phi::TypeTag<int> >::Compute<1, 2, 0, 0, phi::OneDNNContext const, phi::DenseTensor const, phi::DenseTensor const>(phi::KernelContext*, phi::OneDNNContext const&, phi::DenseTensor const&, phi::DenseTensor const&)
 16:32:16 umayr-home bash[36696]: 6   void phi::fusion::FusedConv2DKernel<float, phi::OneDNNContext>(phi::OneDNNContext const&, phi::DenseTensor const&, phi::DenseTensor const&, paddle::optional<phi::DenseTensor> const&, paddle::optional<phi::DenseTensor> const&, std::vector<int, std::allocator<int> > const&, std::vector<int, std::allocator<int> > const&, std::string const&, std::vector<int, std::allocator<int> > const&, int, std::string const&, std::string const&, std::string const&, bool, bool, phi::DenseTensor*)
 16:32:16 umayr-home bash[36696]: 7   void phi::ConvOnednn<float, phi::OneDNNContext>(phi::OneDNNContext const&, phi::DenseTensor const*, phi::DenseTensor const*, phi::DenseTensor const*, phi::DenseTensor const*, std::vector<int, std::allocator<int> > const&, std::vector<int, std::allocator<int> > const&, std::string const&, std::vector<int, std::allocator<int> > const&, int, std::string const&, bool, bool, std::string const&, bool, bool, phi::DenseTensor*)
 16:32:16  16:32:16 umayr-home bash[36696]: 8   phi::ComputeFP32<float, float>(phi::OneDNNContext const&, phi::DenseTe
nsor const*, phi::DenseTensor const*, phi::DenseTensor const*, phi::DenseTensor const*, std::vector<int, std::alloca
tor<int> > const&, std::vector<int, std::allocator<int> > const&, std::string const&, std::vector<int, std::allocato
r<int> > const&, int, std::string const&, bool, bool, std::string const&, bool, bool, phi::DenseTensor*)::{lambda()#
1}::operator()() const::{lambda()#1}::operator()() const
 16:32:16 umayr-home bash[36696]: 9   phi::funcs::OneDNNHandlerT<float, dnnl::convolution_forward, dnnl::con
volution_backward_data, dnnl::convolution_backward_weights>::AcquireReorder(std::shared_ptr<dnnl::memory> const&, std::shared_ptr<dnnl::memory> const&)
 16:32:16 umayr-home bash[36696]: 10  dnnl::reorder::primitive_desc::primitive_desc(dnnl::memory const&, dnnl::memory const&, dnnl::primitive_attr const&, bool)
 16:32:16 umayr-home bash[36696]: 11  dnnl::memory::get_desc() const
 16:32:16 umayr-home bash[36696]: ----------------------
 16:32:16 umayr-home bash[36696]: Error Message Summary:
 16:32:16 umayr-home bash[36696]: ----------------------
 16:32:16 umayr-home bash[36696]: FatalError: `Segmentation fault` is detected by the operating system.
 16:32:16 umayr-home bash[36696]:   [TimeInfo: *** Aborted at 1708169536 (unix time) try "date -d @1708169536" if you are using GNU date ***]
 16:32:16 umayr-home bash[36696]:   [SignalInfo: *** SIGSEGV (@0x0) received by PID 36696 (TID 0x7f76ab7fd640) from PID 0 ***]

我们提供了AceIssueSolver来帮助你解答问题,你是否想要它来解答(请填写yes/no)?/We provide AceIssueSolver to solve issues, do you want it? (Please write yes/no): no

请尽量不要包含图片在问题中/Please try to not include the image in the issue.

fanxing-6 commented 7 months ago

我也遇到了 wsl2 ubuntu22.04环境

zjlw commented 7 months ago

内存或者显存不够了吧?

fanxing-6 commented 7 months ago

不是 是需要用 conda 安装paddle pip安装会出现这个问题

umayrh commented 7 months ago

不是 是需要用 conda 安装paddle pip安装会出现这个问题

Alright. Thanks