TextFuseNet icon indicating copy to clipboard operation
TextFuseNet copied to clipboard

UnpicklingError of model weights

Open NikolaiG-A opened this issue 4 years ago • 2 comments

Hi, thank you for sharing your work and its results!

After downloading pretrained models I try to run demo files icdar2015_detection.py and icdar2013_detection.py on provided pre-trained models on Google drive. However, I experience the following UnpicklingError (see below). I ran a model on a Google colab.

Could you help me with that?

Config './configs/ocr/icdar2015_101_FPN.yaml' has no VERSION. Assuming it to be compatible with latest v2. Traceback (most recent call last): File "demo/icdar2015_detection.py", line 120, in detection_demo = VisualizationDemo(cfg) File "/content/TextFuseNet/demo/predictor.py", line 35, in init self.predictor = DefaultPredictor(cfg) File "/content/TextFuseNet/detectron2/engine/defaults.py", line 156, in init checkpointer.load(cfg.MODEL.WEIGHTS,False) File "/usr/local/lib/python3.7/site-packages/fvcore/common/checkpoint.py", line 102, in load checkpoint = self._load_file(path) File "/content/TextFuseNet/detectron2/checkpoint/detection_checkpoint.py", line 42, in _load_file loaded = super()._load_file(filename) # load native pth checkpoint File "/usr/local/lib/python3.7/site-packages/fvcore/common/checkpoint.py", line 202, in _load_file return torch.load(f, map_location=torch.device("cpu")) File "/usr/local/lib/python3.7/site-packages/torch/serialization.py", line 426, in load return _load(f, map_location, pickle_module, **pickle_load_args) File "/usr/local/lib/python3.7/site-packages/torch/serialization.py", line 603, in _load magic_number = pickle_module.load(f, **pickle_load_args) _pickle.UnpicklingError: invalid load key, '<'.

NikolaiG-A avatar Apr 19 '21 14:04 NikolaiG-A

I have same error...

da-head0 avatar Apr 22 '21 16:04 da-head0

This might have happened if the .pth file was not downloaded properly. If you are using wget or curl try to check if it was downloaded correctly maybe by using the md5 checksum.

I had the same problem using wget on the google drive file ID. Finally downloaded to local system and then used scp.

aditya1709 avatar Aug 25 '21 11:08 aditya1709