Skip to content

OSError: [Errno 22] on Detectron2LayoutModel() #140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
FuJiK0 opened this issue May 24, 2022 · 9 comments
Open

OSError: [Errno 22] on Detectron2LayoutModel() #140

FuJiK0 opened this issue May 24, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@FuJiK0
Copy link

FuJiK0 commented May 24, 2022

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 FuJiK0 added the bug Something isn't working label May 24, 2022
@jiboncom
Copy link

jiboncom commented Jun 9, 2022

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 .

@Micheduc25
Copy link

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?

@jiboncom
Copy link

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.

@lolipopshock
Copy link
Member

lolipopshock commented Jul 3, 2022

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!

@MarouaneZ1
Copy link

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
Copy link

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

@zellsophia
Copy link

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

@uzairaslam19
Copy link

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

@1042312930
Copy link

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

i find this in
#15
image

codexvn added a commit to codexvn/layout-parser that referenced this issue Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants