Skip to content
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

Model library #317

Open
bw4sz opened this issue Mar 28, 2022 · 5 comments
Open

Model library #317

bw4sz opened this issue Mar 28, 2022 · 5 comments
Assignees
Labels
API This tag is used for small improvements to the readability and usability of the python API. dependencies Pull requests that update a dependency file Docs Documentation

Comments

@bw4sz
Copy link
Collaborator

bw4sz commented Mar 28, 2022

@ethanwhite, @henrykironde and I were discussing that as the number of trained models increase, we probably want some more refined way of versioning them and calling them. Right now they are saved alongside the release tags. Each new model would get a "use_release" method, with redundant code, etc.

An example release looks like:

https://github.com/weecology/DeepForest/releases/tag/1.0.0

Which is fine. When use_release is called, the model checks github for the latest release. A couple problems.

  1. It doesn't ask the user if they want to use the new release, so any update to the model should be considered breaking. That seems like a big problem and we should atleast ask if we should update.
  2. The metadata doesn't live alongside the model in python. There is a link, but not alot of info.
from deepforest import main
m = main.deepforest()
Reading config file: deepforest_config.yml
m.use_release()
Model from DeepForest release https://github.com/weecology/DeepForest/releases/tag/1.0.0 was already downloaded. Loading model from file.
Loading pre-built model: https://github.com/weecology/DeepForest/releases/tag/1.0.0
m.__release_version__
'https://github.com/weecology/DeepForest/releases/tag/1.0.0'
  1. Torchvision recently released some API improvements. I think they are largely redundant with pytorch lightning.
    https://pytorch.org/blog/introducing-torchvision-new-multi-weight-support-api/
    I have not read deeply enough to know if they can be used in parallel.
@bw4sz bw4sz added the help wanted Extra attention is needed label Mar 29, 2022
@ayeankit
Copy link

Hey @bw4sz , I would like to work on this issue, Can you please guide me?

@henrykironde
Copy link
Contributor

What have you done so far?

@bw4sz bw4sz added dependencies Pull requests that update a dependency file Docs Documentation API This tag is used for small improvements to the readability and usability of the python API. and removed help wanted Extra attention is needed labels Oct 15, 2023
@ethanwhite
Copy link
Member

It seems like moving to Hugging Face for model distribution is the most common solution here. If we use the pytorch integration:

https://huggingface.co/docs/hub/models-uploading#upload-a-pytorch-model-using-huggingfacehub

then we can use the from_pretrained() method and pass in any of our models (and potentially others models as well; we can wrap from_pretained in use_release as well for backward compatibility):

model.from_pretrained("weecology/deepforest-trees")

I setup an org account https://huggingface.co/weecology and can add @bw4sz & @henrykironde if this sounds like the general way to go.

@bw4sz
Copy link
Collaborator Author

bw4sz commented May 28, 2024

@henrykironde this will be an issue i'll connect to alive/dead model.

@bw4sz
Copy link
Collaborator Author

bw4sz commented Jul 26, 2024

What we want

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API This tag is used for small improvements to the readability and usability of the python API. dependencies Pull requests that update a dependency file Docs Documentation
Projects
None yet
Development

No branches or pull requests

4 participants