-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
usage in multi-user environments -> automated weights download #53
Comments
Absolutely agreed! I'll look into it today. Sorry for this feature taking so long. |
A couple comments on this:
Having said that:
Having said that [2]:
|
Yes, I agree. It should not be downloaded automatically. |
Yes, I think a CLI option to download the weights (with an optional path argument) is the way to go. And the check in case a checkpoint has not been provided is nice to have, but not essential IMO. |
MemBrain-seg models now available on Zenodo: https://zenodo.org/records/10633840 However, I was not able to add you as data curator, @alisterburt . As far as I understand, this feature works only for Zenodo communities, where multiple people can take various roles. So maybe it makes sense if you create a teamtomo community on Zenodo, and we add the MemBrain-seg weights submission to this community? |
Is it possible to have the weights available by default rather than needing their path to be specified every time if they are in a shared location with the proposed setup? This would be ideal - otherwise agree with what you've all said! We could also have a prompt at the CLI which asks if you want to download/where you want to download to and this could run by default on the first run of the program, rather than a separate download program? |
Basically, can we persistently set the default location for the checkpoint from the download code |
Yes, would be cool if the checkpoint argument doesn't need to be passed every time membrain-seg is running. Would it make sense to have a config file with the location to the checkpoint file? Or is there a more elegant way to do this? |
I don't love config files for such a simple application, they introduce extra state and an extra step to running the program Thanks for looking at zenodo I'll look into a community today :-) |
Agree with @alisterburt that config files should be avoided, especially for simple things like this. My suggestion is to specify the checkpoint path through an environment variable like If the environment variable is empty/unset then the model must be specified via the CLI argument (as is currently). Alternatively, we don't ask anything but just add an extra option to |
@rdrighetto You can set arbitrary environment variables when activating a conda environment in a unix system by adding shell scripts to the (warp_build) [burta2@ec-hub1-sc1 ~]$ ls /home/burta2/mambaforge/envs/warp_build/etc/conda/
activate.d/ deactivate.d/ I would still add a code path for being prompted to download the weights to a user-space cache if they are not provided at the CLI or in the environment variable. |
okay: to summarise Ideal version of the future
sound good?! |
I created a "community" on zenodo - could I get your zenodo usernames so we can all curate the record? I need to figure out how to add existing records to a community too :-) |
Great, thanks for creating the community! My username is Lorenz_Lamm. As far as I understand anyone can apply for adding their existing Zenodo entries to a community, so existing records shouldn't be a problem :) |
I like the setting of environment variables, but is there a clever way to edit the activation scripts? (I guess also depends on conda vs virtualenv vs ...). So probably the user would need to do that manually, right? I feel this makes the threshold to use it a bit higher. Would something like python-dotenv (https://pypi.org/project/python-dotenv/) be an option? We could create an .env file (I know, it's basically a config file :D), but fill it automatically when running membrain-seg and downloading a model to a specified location. This could reduce user input and make it maybe easier to use. |
Sounds great to me!
I agree that Most importantly, I think the current way of using membrain-seg (explicit CLI option with the checkpoint) should remain unchanged to minimize disruption to user's workflows. |
@rdrighetto do you have a zenodo account? I'm with @rdrighetto here, the people setting up the installation in the multi-user environment will be comfortable with setting an environment variable in the activation script. For single-user situations, the weights downloaded/cached with pooch will work transparently. |
Okay, sounds good. Then let's add that as some advanced installation instruction somewhere, but keep the basic functionalities as they are. :) |
Thanks for adding me to the Zenodo community. I just accepted the invitation, and submitted the previous upload to the community. |
Yeah probably takes some time to sync, I accepted the entry in any case :-) |
I'm trying to install membrain-seg in a multi-user environment where not having the weights download be automated means having to tell each user to download the checkpoint, send it to the cluster before they can use the program - not ideal
I'll outline my suggested implementation below - feedback welcome!
Zenodo recently added support for multiple curators so hosting the data on zenodo will work well.
alisterburt
) to also manage the entry.https://github.com/teamtomo/fidder/blob/3ac64b13db256b598bf8951eb9a66137c04b86b6/src/fidder/model/_pretrained_weights.py#L6-L16
@LorenzLamm what do you think?
The text was updated successfully, but these errors were encountered: