nasaharvest / presto

Lightweight, Pre-trained Transformers for Remote Sensing Timeseries
https://arxiv.org/abs/2304.14065
MIT License
151 stars 26 forks source link

Presto import triggers directory creation which does not always work #25

Open kvantricht opened 8 months ago

kvantricht commented 8 months ago

Hi guys,

during a Presto import, this line always gets triggered: https://github.com/nasaharvest/presto/blob/182d590a0a67ed6a87c159560d2aa65325644b15/presto/utils.py#L22

On some systems like our cluster, where a Python wheel containing Presto is shipped and deployed, this does not work. I fixed it for now locally by catching the error without failing and the rest of the code (computing Presto encodings) worked without issue on the cluster. So it's something to look at.

gabrieltseng commented 8 months ago

Which functions are you using from the Presto codebase?

I think it would make sense to split a lot of the functionality out into a (much simpler) pip-installable package, but my guess is that only two things (the Presto model itself, and the utils function to make data) are necessary.

As a note, we do have single_file_presto.py which is intended for easy integration into other applications (since it just requires a single file to be copied into another application), but this doesn't solve the requirements issues.

kvantricht commented 8 months ago

At the moment only construct_single_presto_input and Presto.load_pretrained from which we use the encoder. But we're only getting started ;-) I'll take a look at the single file implementation!