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

conda env genreation #672

Open
oeway opened this issue Dec 6, 2024 · 1 comment
Open

conda env genreation #672

oeway opened this issue Dec 6, 2024 · 1 comment

Comments

@oeway
Copy link
Contributor

oeway commented Dec 6, 2024

Currently it seems there are some packages produced by get_conda_env are not necessary or unfit for different cases? Can we provide different flavors of it maybe?

from bioimageio.spec import ValidationSummary, save_bioimageio_package, load_model_description
from bioimageio.core import test_model

from bioimageio.spec.get_conda_env import get_conda_env
descr = load_model_description("emotional-cricket")
wf = descr.weights.pytorch_state_dict

assert wf is not None

conda_env_spec = get_conda_env(entry=wf, env_name="DROP")
print(conda_env_spec.model_dump(mode="json", exclude_defaults=True))
{'channels': ['pytorch', 'conda-forge', 'nodefaults'], 'dependencies': ['cpuonly', 'mkl ==2024.0.0', 'numpy <2', 'pip', 'pytorch==1.12.1', 'setuptools <70.0.0', 'torchaudio==0.12.1', 'torchvision==0.13.1']}

In the above example, I would maybe skip 'cpuonly' (because we will sometimes run it on gpu), 'numpy', 'pip' and 'setuptools' can be excluded as well.

@FynnBe
Copy link
Member

FynnBe commented Dec 6, 2024

  • cpuonly yes, I suppose we should just change to gpu envs (that should be ale run on cpu as well). If that's not sufficient we need to provide two flavors.. let's see if we can avoid that.
  • numpy is there for the pin <2 for pytorch < 2.3, for higher pytorch versions it will not be pinned
  • setuptools is pinned for pytorch < 2.2 to avoid this issue

So for now, I'll just remove cpuonly (see #673 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants