Skip to content

_pickle.UnpicklingError: invalid load key, '<'. #180

Open
@cullen122

Description

@cullen122

I am facing error while building the detectron2 base model from the example given in github and I receive the following error. Couldnt find any solution. Is there anyone facing this issue as well?

PLATFORM : Windows 10

model_final.pth: 942kB [00:02, 436kB/s]
Traceback (most recent call last):
File "C:\Users\Alexander\layoutTest\main.py", line 3, in
model = lp.Detectron2LayoutModel(
File "C:\Users\Alexander\anaconda3\envs\detectron_env\lib\site-packages\layoutparser\models\detectron2\layoutmodel.py", line 119, in init
self._create_model()
File "C:\Users\Alexander\anaconda3\envs\detectron_env\lib\site-packages\layoutparser\models\detectron2\layoutmodel.py", line 122, in _create_model
self.model = detectron2.engine.DefaultPredictor(self.cfg)
File "C:\Users\Alexander\layoutTest\detectron2\detectron2\engine\defaults.py", line 288, in init
checkpointer.load(cfg.MODEL.WEIGHTS)
File "C:\Users\Alexander\layoutTest\detectron2\detectron2\checkpoint\detection_checkpoint.py", line 62, in load
ret = super().load(path, *args, **kwargs)
File "C:\Users\Alexander\anaconda3\envs\detectron_env\lib\site-packages\fvcore\common\checkpoint.py", line 155, in load
checkpoint = self._load_file(path)
File "C:\Users\Alexander\layoutTest\detectron2\detectron2\checkpoint\detection_checkpoint.py", line 99, in _load_file
loaded = self._torch_load(filename)
File "C:\Users\Alexander\layoutTest\detectron2\detectron2\checkpoint\detection_checkpoint.py", line 114, in _torch_load
return super()._load_file(f)
File "C:\Users\Alexander\anaconda3\envs\detectron_env\lib\site-packages\fvcore\common\checkpoint.py", line 252, in _load_file
return torch.load(f, map_location=torch.device("cpu"))
File "C:\Users\Alexander\anaconda3\envs\detectron_env\lib\site-packages\torch\serialization.py", line 815, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "C:\Users\Alexander\anaconda3\envs\detectron_env\lib\site-packages\torch\serialization.py", line 1033, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, '<'.

Process finished with exit code 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions