首页 PaddleOCR 帖子详情
使用文字识别模块出错
收藏
快速回复
PaddleOCR 问答OCR文本 3869 12
使用文字识别模块出错
收藏
快速回复
PaddleOCR 问答OCR文本 3869 12

使用 hub run chinese_ocr_db_crnn_server --input_path "/PATH/TO/IMAGE"时出错: File "c:\programdata\anaconda3\lib\ctypes\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] 找不到指定的模块。

 

请问是什么原因?

0
收藏
回复
全部评论(12)
时间顺序
thinc
#2 回复于2020-12

麻烦贴一下完整的报错信息

0
回复
thinc
#3 回复于2020-12

hub下的ocr没记错的话是需要shapely和pyclipper两个库的,而shapely无法通过pip直接安装,需要下载.whl再安装

0
回复
w
weigh在路上
#4 回复于2020-12

0
回复
w
weigh在路上
#5 回复于2020-12

0
回复
w
weigh在路上
#6 回复于2020-12

0
回复
w
weigh在路上
#7 回复于2020-12
thinc #2
麻烦贴一下完整的报错信息

非常感谢!非常感谢!

0
回复
w
weigh在路上
#8 回复于2020-12

(base) C:\Users\Administrator>hub run chinese_ocr_db_crnn_server --input_path "C
:/ocr_work/1.jpg"
c:\programdata\anaconda3\lib\site-packages\win32\lib\pywintypes.py:2: Deprecatio
nWarning: the imp module is deprecated in favour of importlib; see the module's
documentation for alternative uses
import imp, sys, os
c:\programdata\anaconda3\lib\site-packages\pkg_resources\_vendor\pyparsing.py:94
3: DeprecationWarning: Using or importing the ABCs from 'collections' instead of
from 'collections.abc' is deprecated, and in 3.8 it will stop working
collections.MutableMapping.register(ParseResults)
c:\programdata\anaconda3\lib\site-packages\pip\_vendor\packaging\version.py:130:
DeprecationWarning: Creating a LegacyVersion has been deprecated and will be re
moved in the next major release
DeprecationWarning,
c:\programdata\anaconda3\lib\site-packages\pip\_vendor\packaging\version.py:130:
DeprecationWarning: Creating a LegacyVersion has been deprecated and will be re
moved in the next major release
DeprecationWarning,
c:\programdata\anaconda3\lib\site-packages\markupsafe\__init__.py:13: Deprecatio
nWarning: Using or importing the ABCs from 'collections' instead of from 'collec
tions.abc' is deprecated, and in 3.8 it will stop working
from collections import Mapping
[2020-12-04 07:52:03,032] [ WARNING] - The _initialize method in HubModule will
soon be deprecated, you can use the __init__() to handle the initialization of t
he object
W1204 07:52:03.040750 4936 analysis_predictor.cc:1042] Deprecated. Please use C
reatePredictor instead.
[2020-12-04 07:52:03,882] [ WARNING] - The _initialize method in HubModule will
soon be deprecated, you can use the __init__() to handle the initialization of t
he object
Traceback (most recent call last):
File "c:\programdata\anaconda3\lib\runpy.py", line 193, in _run_module_as_main

"__main__", mod_spec)
File "c:\programdata\anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\ProgramData\Anaconda3\Scripts\hub.exe\__main__.py", line 7, in e>
File "c:\programdata\anaconda3\lib\site-packages\paddlehub\commands\utils.py",
line 69, in execute
return com['_entry']().execute(sys.argv[idx:])
File "c:\programdata\anaconda3\lib\site-packages\paddlehub\commands\run.py", l
ine 56, in execute
result = module._run_func(argv[1:])
File "c:\programdata\anaconda3\lib\site-packages\paddlehub\compat\paddle_utils
.py", line 220, in runner
return func(*args, **kwargs)
File "c:\programdata\anaconda3\lib\site-packages\paddlehub\module\module.py",
line 50, in _wrapper
return func(*args, **kwargs)
File "C:\Users\Administrator\.paddlehub\modules\chinese_ocr_db_crnn_server\mod
ule.py", line 541, in run_cmd
visualization=args.visualization)
File "c:\programdata\anaconda3\lib\site-packages\paddlehub\compat\paddle_utils
.py", line 220, in runner
return func(*args, **kwargs)
File "C:\Users\Administrator\.paddlehub\modules\chinese_ocr_db_crnn_server\mod
ule.py", line 248, in recognize_text
images=predicted_data, use_gpu=self.use_gpu, box_thresh=box_thresh)
File "c:\programdata\anaconda3\lib\site-packages\paddlehub\compat\paddle_utils
.py", line 220, in runner
return func(*args, **kwargs)
File "C:\Users\Administrator\.paddlehub\modules\chinese_text_detection_db_serv
er\module.py", line 171, in detect_text
from chinese_text_detection_db_server.processor import DBPreProcess, DBPostP
rocess, draw_boxes, get_image_ext
File "C:\Users\Administrator\.paddlehub\modules\chinese_text_detection_db_serv
er\processor.py", line 9, in
from shapely.geometry import Polygon
File "c:\programdata\anaconda3\lib\site-packages\shapely\geometry\__init__.py"
, line 4, in
from .base import CAP_STYLE, JOIN_STYLE
File "c:\programdata\anaconda3\lib\site-packages\shapely\geometry\base.py", li
ne 19, in
from shapely.coords import CoordinateSequence
File "c:\programdata\anaconda3\lib\site-packages\shapely\coords.py", line 8, i
n
from shapely.geos import lgeos
File "c:\programdata\anaconda3\lib\site-packages\shapely\geos.py", line 154, i
n
_lgeos = CDLL(os.path.join(sys.prefix, 'Library', 'bin', 'geos_c.dll'))
File "c:\programdata\anaconda3\lib\ctypes\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] 找不到指定的模块。

0
回复
w
weigh在路上
#9 回复于2020-12

shapely我已经安装成功了的

0
回复
thinc
#10 回复于2020-12
shapely我已经安装成功了的[图片]

Windows不能直接安装shapely,需要去下载.whl文件再pip

0
回复
thinc
#11 回复于2020-12
thinc #10
Windows不能直接安装shapely,需要去下载.whl文件再pip

具体点说就是我的是3.7版本Python

pip install Shapely-1.7.1-cp37-cp37m-win_amd64.whl

1
回复
w
weigh在路上
#12 回复于2020-12
thinc #11
具体点说就是我的是3.7版本Python pip install Shapely-1.7.1-cp37-cp37m-win_amd64.whl

非常感谢!

这个方法后面试试

我今天在网上查了一通,用下面语句折腾一通后来就好了:

conda install -c conda-forge git

conda install -c conda-forge gitpython

也不知道为什么

 

0
回复
thinc
#13 回复于2020-12
非常感谢! 这个方法后面试试 我今天在网上查了一通,用下面语句折腾一通后来就好了: conda install -c conda-forge git conda install -c conda-forge gitpython 也不知道为什么  
展开

赞~~

0
回复
需求/bug反馈?一键提issue告诉我们
发现bug?如果您知道修复办法,欢迎提pr直接参与建设飞桨~
在@后输入用户全名并按空格结束,可艾特全站任一用户