facebookresearch / segment-anything

The repository provides code for running inference with the SegmentAnything Model (SAM), links for downloading the trained model checkpoints, and example notebooks that show how to use the model.
Apache License 2.0
47.08k stars 5.57k forks source link

State_dict mismatch with the huggingface model #606

Open max-fofanov opened 11 months ago

max-fofanov commented 11 months ago

I stumbled upon a problem: the models have different amount of keys in their state_dicts. Can you please provide a conversion script?

NielsRogge commented 9 months ago

Conversion script is here: https://github.com/huggingface/transformers/blob/main/src/transformers/models/sam/convert_sam_original_to_hf_format.py