KeyError Convert SWIN to Pytorch

I’m using this script (https://github.com/huggingface/transformers/blob/main/src/transformers/models/upernet/convert_swin_upernet_to_pytorch.py) to make this model (A Large-Scale Benchmark for Food Image Segmentation).

I’ve successfully converted it with the updated labels (mccaly/test2 · Hugging Face) but when I try and convert it with the Model’s Checkpoints, swin_small I get huge amount of KeyErrors.

** some people are having an issue unzipping the model checkpoint file so I uploaded here (checkpoints - Google Drive)**

I’m referencing the checkpoint in the script as:
def convert_upernet_checkpoint(model_name, pytorch_dump_folder_path, push_to_hub): local_checkpoint_path = "./checkpoints/iter_80000.pth" state_dict = torch.load(local_checkpoint_path, map_location="cpu") model_state_dict = state_dict['state_dict']

Rather than it pulling the standard checkpoint from https://download.openmmlab.com/mmsegmentation/v0.5/swin/upernet_swin_small_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K/upernet_swin_small_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K_20210526_192015-ee2fff1c.pth.

Any reason why i can’t get it to work with the local checkpoint?