Skip to content

OSError: [Errno 22] Invalid argument #20

Description

@double-evil

Hi,I meet some trouble when I tried using this toolkit.
When I extracted molecule information from PDFs,It shows [Erron 22] and there are some mistakes about file path.
ERROR reported as follows:
Traceback (most recent call last): File "D:\coding practice\pythonproject\OpenChemIE\test.py", line 6, in <module> figure_results = model.extract_reactions_from_figures_in_pdf(pdf_path) File "c:\windows\system32\openchemie\openchemie\interface.py", line 450, in extract_reactions_from_figures_in_pdf figures = self.extract_figures_from_pdf(pdf, num_pages=num_pages, output_bbox=True) File "c:\windows\system32\openchemie\openchemie\interface.py", line 203, in extract_figures_from_pdf return table_ext.extract_all_tables_and_figures(pages, self.pdfparser, content='figures') File "c:\windows\system32\openchemie\openchemie\interface.py", line 74, in pdfparser self.init_pdfparser() File "c:\windows\system32\openchemie\openchemie\interface.py", line 85, in init_pdfparser self._pdfparser = lp.AutoLayoutModel(config_path, model_path=ckpt_path, device=self.device.type) File "D:\WorkSoftware\Anaconda\envs\openchemie\lib\site-packages\layoutparser\models\auto_layoutmodel.py", line 64, in AutoLayoutModel return ALL_AVAILABLE_BACKENDS[backend_name]( File "D:\WorkSoftware\Anaconda\envs\openchemie\lib\site-packages\layoutparser\models\effdet\layoutmodel.py", line 138, in __init__ self._initialize_model(config_path, model_path, label_map, extra_config) File "D:\WorkSoftware\Anaconda\envs\openchemie\lib\site-packages\layoutparser\models\effdet\layoutmodel.py", line 164, in _initialize_model model_path = PathManager.get_local_path(model_path) File "D:\WorkSoftware\Anaconda\envs\openchemie\lib\site-packages\iopath\common\file_io.py", line 1251, in get_local_path bret = handler._get_local_path(path, force=force, **kwargs) File "D:\WorkSoftware\Anaconda\envs\openchemie\lib\site-packages\layoutparser\models\effdet\catalog.py", line 64, in _get_local_path return PathManager.get_local_path(model_url, **kwargs) File "D:\WorkSoftware\Anaconda\envs\openchemie\lib\site-packages\iopath\common\file_io.py", line 1251, in get_local_path bret = handler._get_local_path(path, force=force, **kwargs) File "D:\WorkSoftware\Anaconda\envs\openchemie\lib\site-packages\iopath\common\file_io.py", line 835, in _get_local_path with file_lock(cached): File "D:\WorkSoftware\Anaconda\envs\openchemie\lib\site-packages\portalocker\utils.py", line 316, in __enter__ return self.acquire() File "D:\WorkSoftware\Anaconda\envs\openchemie\lib\site-packages\portalocker\utils.py", line 270, in acquire fh = self._get_fh() File "D:\WorkSoftware\Anaconda\envs\openchemie\lib\site-packages\portalocker\utils.py", line 329, in _get_fh open( # noqa: SIM115 OSError: [Errno 22] Invalid argument: 'C:\\Users\\andyjiang/.torch/iopath_cache\\s/gxy11xkkiwnpgog\\publaynet-tf_efficientdet_d1.pth.tar?dl=1.lock'
Mistakes happen when it operates to utils.py in portalocker module.
Here are some infomation about my operating env:
python 3.9.21
portalock 3.1.1
iopath 0.1.10

I am looking forward to your reply and I will appretiate it if you could reply as fast as possible!Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions