namtuanly / MTL-TabNet

MTL-TabNet: Multi-task Learning based Model for Image-based Table Recognition
Apache License 2.0
78 stars 12 forks source link

ModuleNotFoundError: No module named 'mmocr.apis.inference' #3

Open XakepML opened 1 year ago

XakepML commented 1 year ago

Getting this while running inference even after installing (pip install mmocr) :-

Traceback (most recent call last): File "./table_recognition/demo/demo.py", line 8, in from mmocr.apis.inference import model_inference ModuleNotFoundError: No module named 'mmocr.apis.inference' (ocr) tensax@tensax-G7-7588:~/Downloads/MTL-TabNet$

namtuanly commented 1 year ago

Sorry for the late reply. Did you run the command at {Path to MTL-TabNet}?

cd {Path to MTL-TabNet} python ./table_recognition/demo/demo.py

namtuanly commented 1 year ago

Did you successfully install mmocr? Can you show the message after installing mmocr on your machine?

Adarsh0047 commented 8 months ago

I faced the same error. It is because in mmocr >= 1.0.0, mmocr.apis.inference was replaced by something known as mmocr.apis.inferencer.

One fix to this problem is to install an older version of mmocr. I installed 0.6.2 version of mmocr.

You can do it by running the following commands:

%pip install -U openmim !wget https://github.com/open-mmlab/mmocr/archive/refs/tags/v0.6.2.zip !unzip v0.6.2.zip %cd mmocr-0.6.2 !mim install -e .