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

The following command produces an error

Open nfeliccia opened this issue 3 years ago • 2 comments

Describe the bug A clear and concise description of what the bug is. Internally producing an invalid argument trying to load config.yaml for the model .

To Reproduce Steps to reproduce the behavior:

  1. What command or script did you run?
from layoutparser.models import Detectron2LayoutModel

model = Detectron2LayoutModel('lp://PubLayNet/mask_rcnn_X_101_32x8d_FPN_3x/config',
                              extra_config=["MODEL.ROI_HEADS.SCORE_THRESH_TEST", 0.5],
                              label_map={0: "Text", 1: "Title", 2: "List", 3: "Table", 4: "Figure"})

Environment

  1. Please describe your Platform [Windows/MacOS/Linux] - windows 10
  2. Please show the Layout Parser version -
  3. You may add addition that may be helpful for locating the problem, such as
    • How you installed PyTorch [e.g., pip, conda, source]
    • Other environment variables that may be related (such as $PATH, $LD_LIBRARY_PATH, $PYTHONPATH, etc.)

Error traceback If applicable, paste the error traceback here. Traceback (most recent call last):

File "C:\layoutparserdirty\layout_processor.py", line 3, in <module>
   model = Detectron2LayoutModel('lp://PubLayNet/mask_rcnn_X_101_32x8d_FPN_3x/config',
 File "C:\layoutparserdirty\venv\lib\site-packages\layoutparser\models\detectron2\layoutmodel.py", line 91, in __init__
   config_path = PathManager.get_local_path(config_path)
 File "C:\layoutparserdirty\venv\lib\site-packages\iopath\common\file_io.py", line 1197, in get_local_path
   bret = handler._get_local_path(path, force=force, **kwargs)
 File "C:\layoutparserdirty\venv\lib\site-packages\layoutparser\models\detectron2\catalog.py", line 136, in _get_local_path
   return PathManager.get_local_path(model_url, **kwargs)
 File "C:\layoutparserdirty\venv\lib\site-packages\iopath\common\file_io.py", line 1197, in get_local_path
   bret = handler._get_local_path(path, force=force, **kwargs)
 File "C:\layoutparserdirty\venv\lib\site-packages\iopath\common\file_io.py", line 794, in _get_local_path
   with file_lock(cached):
 File "C:\layoutparserdirty\venv\lib\site-packages\portalocker\utils.py", line 157, in __enter__
   return self.acquire()
 File "C:\layoutparserdirty\venv\lib\site-packages\portalocker\utils.py", line 239, in acquire
   fh = self._get_fh()
 File "C:\layoutparserdirty\venv\lib\site-packages\portalocker\utils.py", line 289, in _get_fh
   return open(self.filename, self.mode, **self.file_open_kwargs)
OSError: [Errno 22] Invalid argument: 'C:\\Users\\nfeliccia/.torch/iopath_cache\\s/nau5ut6zgthunil\\config.yaml?dl=1.lock'

Process finished with exit code 1

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

nfeliccia avatar Jul 25 '22 19:07 nfeliccia

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

I am getting same error. Running this on windows 10. its working in google colab but not in Jupter notebook or when run through flask.

Let me know how to resolve it.

ArvinderKumar133 avatar Jan 20 '23 07:01 ArvinderKumar133