ibm-aur-nlp/PubLayNet

model cannot be downloaded automatically.

aysebilginn opened this issue · 5 comments

I'm new in deep learning so i may be doing many things wrong. I'm just trying to re-do the deep layout parsel example to learn and I'm having trouble with this part of the code:
model = lp.Detectron2LayoutModel('lp://PubLayNet/faster_rcnn_R_50_FPN_3x/config',
extra_config=["MODEL.ROI_HEADS.SCORE_THRESH_TEST", 0.8],
label_map={0: "Text", 1: "Title", 2: "List", 3:"Table", 4:"Figure"})
# Load the deep layout model from the layoutparser API
# For all the supported model, please check the Model
# Zoo Page: https://layout-parser.readthedocs.io/en/latest/notes/modelzoo.html

It gives me FileNotFoundError: [Errno 2] No such file or directory: '/root/.torch/iopath_cache/s/dgy9c10wykk4lq4/model_final.pth' error and do not autmatically download the model. Why is that and how can i solve it?
PS: i tried to download it manually but this time i have corrupted file errors.

It's turned out that it's about the version of the detectron2. I've changed it and it works right now without any problem.

Which version did you change it to?

Which version did you change it to?

Install these below:

!pip install pytest
!pip install torch
!pip install numpy
!pip install opencv-python
!pip install pandas
!pip install docutils==0.16
!pip install Sphinx==3.0.0
!pip install recommonmark==0.6.0
!pip install sphinx-markdown-tables
!pip install sphinx_rtd_theme
!pip install google-cloud-vision==1
!pip install pytesseract
!pip install pycocotools
!pip install layoutparser torchvision
!pip install "git+https://github.com/facebookresearch/detectron2.git@v0.5#egg=detectron2"
!pip install paddlepaddle
!pip install effdet
!pip install cython

and

!pip install layoutparser # Install the base layoutparser library with
!pip install "layoutparser[layoutmodels]" # Install DL layout model toolkit
!pip install "layoutparser[effdet]"
!pip install "layoutparser[paddledetection]"
!pip install "layoutparser[ocr]"

I didn't used to have the one in bold, it was just detectron2 back then. After installing these you should not be having any errors. Mine is working fine right now. Best of luck!

closed