DevashishPrasad / CascadeTabNet

This repository contains the code and implementation details of the CascadeTabNet paper "CascadeTabNet: An approach for end to end table detection and structure recognition from image-based documents"
MIT License
1.46k stars 422 forks source link

TypeError: CascadeRCNN: __init__() got an unexpected keyword argument 'num_stages' #132

Open ajay311517104001 opened 3 years ago

ajay311517104001 commented 3 years ago

getting this TypeError

birdzzzz commented 3 years ago

I have the same problem

ZafarShadman09 commented 3 years ago

I am also getting the same problem.

ZafarShadman09 commented 3 years ago

In the collab where inference is made, use that dependencies, this solved my issue. !pip install torch==1.4.0+cu100 torchvision==0.5.0+cu100 -f https://download.pytorch.org/whl/torch_stable.html !pip install -q mmcv terminaltables !git clone --branch v1.2.0 'https://github.com/open-mmlab/mmdetection.git' %cd "mmdetection" !pip install -r "/content/mmdetection/requirements/optional.txt" !python setup.py install !python setup.py develop !pip install -r {"requirements.txt"} !pip install pillow==6.2.1 [SOLVED]

kmanojkkmr commented 3 years ago

I assume you are using MMDetection Version 2.*, if yes then change the config file i.e from cascade_mask_rcnn_hrnetv2p_w32_20e.py to cascade_mask_rcnn_hrnetv2p_w32_20e_v2.py You can find the config files in the below link https://github.com/DevashishPrasad/CascadeTabNet/tree/master/Config

I hope this will resolve your issue.

Alex-lubo commented 2 years ago

Just use config file: cascade_mask_rcnn_hrnetv2p_w32_20e_v2.py. and then update checkpoints file with Tools/upgrade_model_version.py. done!

np-n commented 1 year ago

fixed by updating config_file to cascade_mask_rcnn_hrnetv2p_w32_20e_v2.py. and then upgrading the version of the model by running !python /content/CascadeTabNet/Tools/upgrade_model_version.py /content/epoch_36.pth /content/new_epoch_36.pth, and set checkpoint_file to /content/new_epoch_36.pth.

Jsooooooo commented 1 year ago

oh its useful for me! I have try many version of torch, cuda, mmdet, mmcv

Pravin770 commented 11 months ago

@np-n

fixed by updating config_file to cascade_mask_rcnn_hrnetv2p_w32_20e_v2.py. and then upgrading the version of the model by running !python /content/CascadeTabNet/Tools/upgrade_model_version.py /content/epoch_36.pth /content/new_epoch_36.pth, and set checkpoint_file to /content/new_epoch_36.pth.

Based on the above method, the issue got fixed. But while plotting its throwing the below error

image

How can I fix this??

np-n commented 11 months ago

@Pravin770 , you have to change the argument of the show_result_pyplot() from show_result_pyplot(img, result,('Bordered', 'cell', 'Borderless'), score_thr=0.85) to show_result_pyplot(model, img, result, score_thr=0.85).