Closed veeralakrishna closed 1 month ago
The problem arises from the code trying to load the pretrained vision encoder (e.g. a ResNet 50) too, which it does from HuggingFace too.
To just load the location encoder you'll have to write a custom function that creates a LocationEncoder()
class (from here: https://github.com/microsoft/satclip/blob/main/satclip/location_encoder.py) and then loads the part of the state_dict from satclip-vit16-l40.ckpt
that is just the location encoder.
Hope this helps!
Lightweight loading that supports offline use is now available here: https://github.com/microsoft/satclip/blob/main/satclip/load_lightweight.py. Thanks to @crastoru.
Issue Description: I have downloaded the SATClip model named satclip-vit16-l40.ckpt from Hugging Face and stored it at /pretrained_models/satclip/resnet16-l40/satclip-vit16-l40.ckpt. I attempted to load the locally stored model using the provided code in my working environment without internet access. However, I encountered the following error. Seeking guidance on successfully loading and utilising a locally downloaded and stored SATClip model without accessing the internet.
Looking forward to your assistance in resolving this issue promptly. Thank you.