eragonruan / text-detection-ctpn

text detection mainly based on ctpn model in tensorflow, id card detect, connectionist text proposal network
MIT License
3.43k stars 1.34k forks source link

ImportError: cannot import name 'bbox' from partially initialized module 'lib.utils' (most likely due to a circular import) (/home/barry/Github/chinese_ocr/ctpn/lib/utils/__init__.py) #481

Open Barry1915 opened 3 years ago

Barry1915 commented 3 years ago

Traceback (most recent call last): File "/home/barry/Github/chinese_ocr/demo.py", line 3, in import ocr File "/home/barry/Github/chinese_ocr/ocr.py", line 10, in from ctpn.text_detect import text_detect File "/home/barry/Github/chinese_ocr/ctpn/text_detect.py", line 6, in from lib.utils.timer import Timer File "/home/barry/Github/chinese_ocr/ctpn/lib/init.py", line 1, in from . import fast_rcnn File "/home/barry/Github/chinese_ocr/ctpn/lib/fast_rcnn/init.py", line 2, in from . import train File "/home/barry/Github/chinese_ocr/ctpn/lib/fast_rcnn/train.py", line 5, in from ..roi_data_layer.layer import RoIDataLayer File "/home/barry/Github/chinese_ocr/ctpn/lib/roi_data_layer/init.py", line 1, in from . import roidb File "/home/barry/Github/chinese_ocr/ctpn/lib/roi_data_layer/roidb.py", line 5, in from lib.utils.bbox import bbox_overlaps File "/home/barry/Github/chinese_ocr/ctpn/lib/utils/init.py", line 4, in from . import bbox ImportError: cannot import name 'bbox' from partially initialized module 'lib.utils' (most likely due to a circular import) (/home/barry/Github/chinese_ocr/ctpn/lib/utils/init.py)

Barry1915 commented 3 years ago

谁能帮帮我解决一下这个问题啊

wxydaydayup commented 2 years ago

在报错的地方上面加上这两行 import pyximport pyximport.install()

nissansz commented 2 years ago

import pyximport pyximport.install()

win10下也报这个错误。怎么解决?微信 nlanguage