RuntimeError: (PreconditionNotMet) Tensor not initialized yet when Tensor::type() is called.

See original GitHub issue
2021-05-25 11:15:18,710 - ERROR - Exception on /ocr [POST]
Traceback (most recent call last):
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python37\lib\site-packages\flask\app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python37\lib\site-packages\flask\app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python37\lib\site-packages\flask\app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python37\lib\site-packages\flask\_compat.py", line 39, in reraise
    raise value
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python37\lib\site-packages\flask\app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python37\lib\site-packages\flask\app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "e:\xxx\app.py", line 90, in paddle
    result = chineseOCREngine.ocr(image, cls=False)
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python37\lib\site-packages\paddleocr\paddleocr.py", line 383, in ocr
    dt_boxes, rec_res = self.__call__(img)
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python37\lib\site-packages\paddleocr\tools\infer\predict_system.py", line 109, in __call__
    rec_res, elapse = self.text_recognizer(img_crop_list)
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python37\lib\site-packages\paddleocr\tools\infer\predict_rec.py", line 239, in __call__
    output = output_tensor.copy_to_cpu()
RuntimeError: (PreconditionNotMet) Tensor not initialized yet when Tensor::type() is called.
  [Hint: holder_ should not be null.] (at D:\v2.0.1\paddle\paddle/fluid/framework/tensor.h:202)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:19

github_iconTop GitHub Comments

1reaction
blackeyecirclescommented, Jun 9, 2021

@Gavinic 将 predict_det.py, predict_rec.py 的init input_tensor, output_tensor 的初始化函数从__init__ 函数移到 __call__函数,因为这2个变量是需要多线程重入的,放在__init__里面作为公用函数会被覆盖,单线程没问题,但是多线程会冲突

0reactions
paddle-bot-old[bot]commented, Oct 5, 2021

Since you haven't replied for more than 3 months, we have closed this issue/pr. If the problem is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up. It is recommended to pull and try the latest code first. 由于您超过三个月未回复,我们将关闭这个issue/pr。 若问题未解决或有后续问题,请随时重新打开(建议先拉取最新代码进行尝试),我们会继续跟进。

Read more comments on GitHub >

github_iconTop Results From Across the Web

conv2d Tensor not initialized yet when Tensor::type() is called.
conv2d Tensor not initialized yet when Tensor::type() is called. #16134 ... is called. at [/paddle/paddle/fluid/framework/tensor.h:145].
Read more >
RuntimeError: Dst tensor is not initialized in Tensorflow
My suggestion is to reduce the batch_size parameter in your .fit() method. If you did not explicitly define it, then it is set...
Read more >
Tensor not initialized yet when Tensor - AI Studio - 百度
RuntimeError : (PreconditionNotMet) Tensor not initialized yet when Tensor::type() is called. [Hint: holder_ should not be null.] (at /paddle/paddle/fluid/ ...
Read more >
PaddlePaddle报错解决-holder_ should not be null - 简书
... should not be null Tensor not initialized yet when Tensor::type() is called. at [D:\1.4.1\paddle\paddle/fluid/framework/tensor.h:146] ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found