UnpicklingError: invalid load key, '\xef'.

#11
by Sebas6k - opened

2 days ago my code was working using colab:

cfg = get_cfg()
add_vit_config(cfg)
cfg.merge_from_file("cascade_dit_base.yml")
cfg.MODEL.WEIGHTS = "publaynet_dit-b_cascade.pth"

predictor = DefaultPredictor(cfg)

Now gives me this error:

---------------------------------------------------------------------------
UnpicklingError                           Traceback (most recent call last)
[<ipython-input-4-ffffa6d6dad1>](https://localhost:8080/#) in <cell line: 20>()
     18 
     19 # Step 4: define model
---> 20 predictor = DefaultPredictor(cfg)
     21 
     22 def analyze_image(img):

7 frames
[/usr/local/lib/python3.10/dist-packages/torch/serialization.py](https://localhost:8080/#) in _legacy_load(f, map_location, pickle_module, **pickle_load_args)
    918             "functionality.")
    919 
--> 920     magic_number = pickle_module.load(f, **pickle_load_args)
    921     if magic_number != MAGIC_NUMBER:
    922         raise RuntimeError("Invalid magic number; corrupt file?")

UnpicklingError: invalid load key, '\xef'.

Sign up or log in to comment