Tensor holds no memory. Call Tensor::mutable_data firstly. #12367
Replies: 6 comments
-
系统环境/System Environment:Linux CUDA 11.2 多线程并行调用ocr识别代码时,报错 代码示例如下: ocr = PaddleOCR(lang="en", rec_model_type='en', rec_algorithm = 'CRNN', ocr_version = 'PP-OCRv3', result = ocr.ocr('img.jpg') |
Beta Was this translation helpful? Give feedback.
-
did you have the solution for this issue ? i encounter the same error when i want to threading PPOCR. |
Beta Was this translation helpful? Give feedback.
-
我的伙计,或许增加一个time.sleep()延时怎么样? |
Beta Was this translation helpful? Give feedback.
-
getting same issue |
Beta Was this translation helpful? Give feedback.
-
Fix to at least get things running PaddlePaddle/Paddle#56193 (comment) |
Beta Was this translation helpful? Give feedback.
-
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/tornado/web.py",line 1786,in _execute
result = await result
File "/usr/local/lib/python3.8/site-packages/tornado/gen.py", line 780,in run
yielded = self.gen.throw(exc)
File "/home/ocr_wh/paddle0cr/appGPU.py",line 42, in post
tl,t2=yield self.inference(self.request.body )
File "/usr/local/lib/python3.8/site-packages/tornado/gen.py", line 767, in run
value = future.result( )
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57,in run
result = self.fn(*self.args,**self.kwargs)
File "/home/ocr_wh/paddle0cr/appGPU.py",line 90, in inference
ocr_result, infer_elapse = rapid ocr(image_np, box_thresh=box_thresh,
File "/usr/local/lib/python3.8/site-packages/rapidocr_paddle/main.py", line 93, in _call
img,cls_res, cls_elapse = self.text_cls(img)
File "/usr/local/lib/python3.8/site-packages/rapidocr_paddle/ch_ppocr_v2_cls/text_cls.py", line 64, in _call
prob_out = self.infer(norm img_batch)[0]
File "/usr/local/lib/python3.8/site-packages/rapidocr_paddle/utils.py", line 67, in call
output = output_tensor.copy_to_cpu( )
RuntimeError: (PreconditionNotMet)Tensor holds no memory. Call Tensor::mutable_data firstly.
[Hint: holder should not be null.] (at /paddle/paddle/phi/core/dense_tensor_impl.cc:48)
Beta Was this translation helpful? Give feedback.
All reactions