layout-parser icon indicating copy to clipboard operation
layout-parser copied to clipboard

OSError: [Errno 22] on Detectron2LayoutModel()

Open FuJiK0 opened this issue 3 years ago • 9 comments

When I try to Create a Detectron2-based Layout Detection Model, I encounter the following error:

model = lp.Detectron2LayoutModel(
    'lp://PrimaLayout/mask_rcnn_R_50_FPN_3x/config',
    extra_config=["MODEL.ROI_HEADS.SCORE_THRESH_TEST", 0.5],
    label_map={
        1: "TextRegion",
        2: "ImageRegion"
    })

Error:

File f:\Coding\Conda\envs\LP\lib\site-packages\portalocker\utils.py:289, in Lock._get_fh(self)
    [287](file:///f%3A/Coding/Conda/envs/LP/lib/site-packages/portalocker/utils.py?line=286) def _get_fh(self) -> typing.IO:
    [288](file:///f%3A/Coding/Conda/envs/LP/lib/site-packages/portalocker/utils.py?line=287)     '''Get a new filehandle'''
--> [289](file:///f%3A/Coding/Conda/envs/LP/lib/site-packages/portalocker/utils.py?line=288)     return open(self.filename, self.mode, **self.file_open_kwargs)

OSError: [Errno 22] Invalid argument: 'C:\\Users\\60953/.torch/iopath_cache\\s/yc92x97k50abynt\\config.yaml?dl=1.lock'

image

image

Environment

  1. Platform Windows 11
  2. Layout Parser version 0.3.4
  3. Torch version 1.10.0+cu113

FuJiK0 avatar May 24 '22 04:05 FuJiK0

I am also experiencing this in the same environment. It seems to be related to a problem downloading files from the LP API because when downloading the config files and pointing LP to use the local file the error is mentions model_final.pth?dl=1odel_final.pth?dl=1 .

jiboncom avatar Jun 09 '22 08:06 jiboncom

I am also experiencing this in the same environment. It seems to be related to a problem downloading files from the LP API because when downloading the config files and pointing LP to use the local file the error is mentions model_final.pth?dl=1odel_final.pth?dl=1 .

Have you been able to find a solution so far?

Micheduc25 avatar Jun 20 '22 17:06 Micheduc25

Not really. I did a few experiments I needed to run using Google Colab but I couldn't fix the problem in my computer. It seems to be related to the long path issue in Windows but allowing that from registry didn't fix the problem. I didn't try running python on "higher" level folder (I am using Vs Code) but read that it could help.

jiboncom avatar Jun 20 '22 19:06 jiboncom

This seems to be a known issue for Windows users and we plan to implement some important fixes in the next version. Stay tuned -- thanks!

lolipopshock avatar Jul 03 '22 06:07 lolipopshock

i'm trying to use detectron2 model for extraction information but i got this problem, i tried many ways but i failed to solve it, i tried to use google collab but it throws me :"ImportError: you cannot import is_directory", does anyone know how can i fix it ? any help would be appreciated

erreurDetectron erreurDetectronn

MarouaneZ1 avatar Sep 23 '22 21:09 MarouaneZ1

This seems to be a known issue for Windows users and we plan to implement some important fixes in the next version. Stay tuned -- thanks!

did you implement new important fixes yet ? bcz i'm hard stuck on an error : OSerror : invalid argument

MarouaneZ1 avatar Sep 24 '22 16:09 MarouaneZ1

any updates on this issue? Coz I'm still running into it

zellsophia avatar Nov 29 '22 15:11 zellsophia

Any Updates on this? I'm running into same error

uzairaslam19 avatar Jun 07 '23 08:06 uzairaslam19

Any Updates on this? I'm running into same error

i find this in https://github.com/Layout-Parser/layout-parser/issues/15 image

1042312930 avatar Jul 11 '23 00:07 1042312930