Running Detectron2 locally - windows - [Pytorch Config error]
I am trying to run this code locally:
https://gist.github.com/shashank524/74d8f46d5de633b84e2265fcc34774de#file-tabledetection-ipynb
After installing required packages, when I am trying to run this line:
import layoutparser as lp

# PubLayNet
model = layoutparser.Detectron2LayoutModel('lp://PubLayNet/faster_rcnn_R_50_FPN_3x/config',extra_config=[&quot;MODEL.ROI_HEADS.SCORE_THRESH_TEST&quot;, 0.81],label_map={0: &quot;Text&quot;, 1: &quot;Title&quot;, 2: &quot;List&quot;, 3:&quot;Table&quot;, 4:&quot;Figure&quot;})

I receive this error:
OSError: [Errno 22] Invalid argument: 'C:\\Users\\username/.torch/iopath_cache\\s/f3b12qc4hc0yh4m\\config.yml?dl=1.lock'

I looked into the directory and there was no config file available.
I tried to download the config file from here (https://layout-parser.readthedocs.io/en/latest/notes/modelzoo.html) and put it in the directory but it didn't solve the issue!

Even I got a similar error. I tried out manually some work around in Windows.
I am using your case as example: OSError: [Errno 22] Invalid argument: 'C:\Users\username/.torch/iopath_cache\s/f3b12qc4hc0yh4m\config.yml?dl=1.lock'
Please follow the following process.

Navigate to C:\Users\username/.torch/iopath_cache\s/f3b12qc4hc0yh4m\config.yml
Open that config.yaml file

Scroll down to WEIGHTS: https://www.dropbox.com/s/h7th27jfv19rxiy/model_final.pth?dl=1 should be around 265 line.

Copy that link and paste it in your browser, a 'model_final.pth' will be downloaded. Copy this file to your desired folder.

Now replace the path to WEIGHTS: your_desired_folder\model_final.pth

Save it and run the code it works!


But there is a small work around I think before you do this (if you have not done)
iopath work around
https://github.com/Layout-Parser/layout-parser/issues/15 (Github link to the issue)
Hope this helps!
