No module named 'paddleocr.tools'; 'paddleocr' is not a package
收藏
我的环境是没有问题的,在不使用多进程的情况下可以正常导入包,导入代码如下
from paddleocr.tools.infer.utility import get_rotate_crop_image from paddleocr.tools.infer.predict_system import sorted_boxes from paddleocr.ppstructure.table.predict_table import to_excel
但是问题在于,一旦我尝试使用multiprocessing开启多进程,就会出现如下报错
Traceback (most recent call last): File "", line 1, in File "E:\software\Anaconda-5.3.1\anaconda\envs\OCRPy38\lib\multiprocessing\spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "E:\software\Anaconda-5.3.1\anaconda\envs\OCRPy38\lib\multiprocessing\spawn.py", line 125, in _main prepare(preparation_data) File "E:\software\Anaconda-5.3.1\anaconda\envs\OCRPy38\lib\multiprocessing\spawn.py", line 236, in prepare _fixup_main_from_path(data['init_main_from_path']) File "E:\software\Anaconda-5.3.1\anaconda\envs\OCRPy38\lib\multiprocessing\spawn.py", line 288, in _fixup_main_from_path main_content = runpy.run_path(main_path, File "E:\software\Anaconda-5.3.1\anaconda\envs\OCRPy38\lib\runpy.py", line 265, in run_path return _run_module_code(code, init_globals, run_name, File "E:\software\Anaconda-5.3.1\anaconda\envs\OCRPy38\lib\runpy.py", line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File "E:\software\Anaconda-5.3.1\anaconda\envs\OCRPy38\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "E:\project\OCR\10-18\DocExtraction\OCRProcessor\OCRProcessor.py", line 35, in from paddleocr.tools.infer.utility import get_rotate_crop_image ModuleNotFoundError: No module named 'paddleocr.tools'; 'paddleocr' is not a package
只要我使用multiprocessing开启这个paddleocr处理的类的相关进程,就会出现这个报错
我想知道有没有什么办法可以解决这个问题,或者完全放弃这一思路,提供给我一个使用利用多GPU进行OCR识别以加快效率的方法
0
收藏
请登录后评论