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

Add offline download and install of SlicerNNUNet Python dependencies #16

Open
Thibault-Pelletier opened this issue Feb 1, 2025 · 4 comments
Labels
enhancement New feature or request

Comments

@Thibault-Pelletier
Copy link
Collaborator

For use cases of low bandwidth or no access to internet connection, a download and offline install option of the SlicerNNUNet Python dependencies would be interesting.

Problem is not specific to the SlicerNNUNet package and logic / UI components could be contributed back to a dedicated package install module.

@Thibault-Pelletier Thibault-Pelletier added the enhancement New feature or request label Feb 1, 2025
@lassoan
Copy link
Collaborator

lassoan commented Feb 1, 2025

Any Python packages can be easily bundled with extensions (see for example SlicerJupyter extension). Nnunet and its dependencies could be all easily added - except PyTorch, which is huge, and there are variants depending on the available hardware and driver version.

I'm not sure how much it would help if we bundled Python packages if we cannot bundle PyTorch.

@Thibault-Pelletier
Copy link
Collaborator Author

I guess having everything but not PyTorch would not resolve the issue (looking at the current one with PyTorch 2.6 not compatible with nnU-Net weight loading for example).

I was thinking of being able to use the pip download command to get the dependencies from one computer and pip install --find-links options to install them on a similar one but without internet access.

The download option should work (probably not well for light-the-torch...) and the pip install --find-links should work with every other install step (probably just the option to add when calling the slicer.util.pip_install command

@simzhangbest
Copy link

I attempted to integrate PyTorch and various AI plugin packages. As a result, I found that the installation package became extremely large. Of course, it also included some weight files. I believe that if we release such a version directly, the size of the software will be a problem. Moreover, if others use it directly, it needs to be debugged again, especially considering the version issues of the hardware devices.

@lassoan
Copy link
Collaborator

lassoan commented Feb 10, 2025

Slicer is portable (the install tree can be moved anywhere) on all platforms. Therefore, if you need a package that includes everything you can use offline then the simplest is to create one one a computer that has network connection and then zip up the build tree. The model weights would need to be downloaded and placed somewhere within the install tree. Then, in the launcher the TOTALSEG_WEIGHTS_PATH environment variable would be set to point to that location.

That said, as @simzhangbest noted, the package would be very large (about 10GB), and you would need a few versions (at least windows CPU, windows GPU, linux CPU, linux GPU, macOS), so it would not be easy to host it or download it.

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

No branches or pull requests

3 participants