Closed lkluo closed 3 years ago
Please help me out to execute the below command I am unable to run it! it throws an error!
model_PLN_a = lp.Detectron2LayoutModel(
config_path ='lp://PubLayNet/mask_rcnn_X_101_32x8d_FPN_3x/config', # In model catalog
label_map ={0: "Text", 1: "Title", 2: "List", 3:"Table", 4:"Figure"}, # In modellabel_map
extra_config=["MODEL.ROI_HEADS.SCORE_THRESH_TEST", 0.8] # Optional
)
@lkluo Thanks! Would you like to open a PR and have it fixed?
odel_PLN_a = lp.Detectron2LayoutModel( config
Hey @karndeepsingh - could you specify what the error is?
I am unable to run above code in my local but when I run it on colab it download weights and config files of the model. How I can do the same on my local device?
Should be fixed in #69 -- now we use device
instead of enforce_cpu
for specifying devices.
When setting
enforce_cpu
true, still using CUDA instead of CPU. I think it is due to this https://github.com/Layout-Parser/layout-parser/blob/e035fc8f952addc620670e5b47864fe213db0e10/src/layoutparser/models/layoutmodel.py#L120Possible fix could be
cfg.MODEL.DEVICE = "cuda" if torch.cuda.is_available() and (not enforce_cpu) else "cpu"