TerraTorch

Error building model with Terratorch

#1
by morenoj11 - opened

Hi, it is not possible to load the model as indicated under "Use this model":

from terratorch.registry import BACKBONE_REGISTRY

model = BACKBONE_REGISTRY.build("ibm-nasa-geospatial/Prithvi-EO-2.0-300M-BurnScars")

I believe the error lies here: https://github.com/IBM/terratorch/blob/92bd85a16cb7301d90f6b674d32aadfba83b079e/terratorch/models/backbones/prithvi_vit.py#L55-L91, but I'm not sure.

Could you please update either configuration or the instructions on how to load the model?

Thanks!

Note: The error is

KeyError: 'Could not instantiate model ibm-nasa-geospatial/Prithvi-EO-2.0-300M-BurnScars not from any source.'
IBM-NASA Prithvi Models Family org

Thanks for the interest!
You cannot use the BACKBONE_REGISTRY for that. You need to download the model and build the model from the checkpoint, see inference.py for the specific code. If you want to do it automatically, you can check the code in https://huggingface.co./spaces/ibm-nasa-geospatial/Prithvi-EO-2.0-BurnScars-demo/blob/main/app.py.

Sign up or log in to comment