TheJaeLal / LineFormer

Line Chart Data Extraction: Official code for LineFormer - ICDAR23 Paper
23 stars 3 forks source link

Issues when trying to inference the code #1

Closed pratyush-1 closed 1 year ago

pratyush-1 commented 1 year ago

Hello, first I would like to thank you for this amazing contribution, I have recently gone through your research paper and was trying to implement it, so I checked out this codebase and I am kinda new to mmdetection.

I tried to implement the inference on an custom image and I get the following error-

Traceback (most recent call last): File "run.py", line 12, in infer.load_model(CONFIG, CKPT, DEVICE) File "/home/pratyush/LineFormer/infer.py", line 52, in load_model model = init_detector(config, ckpt, device=device) File "/home/pratyush/miniconda3/envs/LineFormer/lib/python3.8/site-packages/mmdet/apis/inference.py", line 61, in init_detector model = MODELS.build(config.model) File "/home/pratyush/miniconda3/envs/LineFormer/lib/python3.8/site-packages/mmengine/registry/registry.py", line 548, in build return self.build_func(cfg, *args, kwargs, registry=self) File "/home/pratyush/miniconda3/envs/LineFormer/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 250, in build_model_from_cfg return build_from_cfg(cfg, registry, default_args) File "/home/pratyush/miniconda3/envs/LineFormer/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 144, in build_from_cfg raise type(e)( AttributeError: class Mask2Former in mmdet/models/detectors/mask2former.py: class Mask2FormerHead in mmdet/models/dense_heads/mask2former_head.py: 'ConfigDict' object has no attribute 'layer_cfg'**

This happens when using the exact code in inference section in README.md I downloaded the weights and changed the paths accordingly.

pratyush-1 commented 1 year ago

Nvm it, I was able to solve it, it was just few dependency issues which I had to resolve,

If anyone encounters the issue, I used mmdet==2.28.0, MMCV==1.7.1, apparently the new version of mmdet==3.0.0 was giving some errors.