general_ocr icon indicating copy to clipboard operation
general_ocr copied to clipboard

ModuleNotFoundError: No module named 'general_ocr._ext'

Open ngthanhtin opened this issue 2 years ago • 3 comments

Dear author, When I run the test command: python general_ocr/utils/ocr.py demo/mrbean.png --print-result --imshow --det TextSnake --recog SEG

The output error is like this: ModuleNotFoundError: No module named 'general_ocr._ext', although I have installed the repo following the instruction in https://github.com/phamdinhkhanh/general_ocr/blob/main/docs/install.md.

Do you know the problem and how to fix that, please?

ngthanhtin avatar Oct 26 '21 01:10 ngthanhtin

gneeral_ocr._ext is a bunch of extension modules in general_ocr which load from pytorch. Thus you have to respond the configuration requirements before installing. Run code collect_env.py to show us your computer environment.

phamdinhkhanh avatar Oct 26 '21 03:10 phamdinhkhanh

I can not run collect_env.py because it imports the general_ocr module as well, so I also encounter the same error when running this file.

ngthanhtin avatar Oct 26 '21 05:10 ngthanhtin

Because you have not successfully installed it yet. So you can not import general_ocr package. I suggest you append absolute path of general_ocr module inside your code collect_env.py:

import sys
sys.path.append('your absolute path/general_general/general_ocr')

And take attention to 1.1. Prerequisites. You have to meet them all.

phamdinhkhanh avatar Oct 26 '21 07:10 phamdinhkhanh