Repository navigation
Keep volumes in memory as float32 - #25
Merged
Merged
Conversation
Volumes were loaded as float64 (nibabel's default) and all training and validation patients stay in memory, e.g. 300 MiB per 512x512x150 scan and 32.5 GiB for 111 patients. Reading them as float32 halves that, and the loading peak, without changing what the model receives (patches were already converted to float32). Predictions are float32 too.
youssefassis
added a commit
that referenced
this pull request
Sep 30, 2026
Keep volumes in memory as float32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Volumes are now read as float32 instead of nibabel's default float64. Since all training and validation patients stay in memory, this halves memory use: 150 MiB instead of 300 MiB for a 512×512×150 scan, about 16 GiB instead of 32.5 GiB for 111 patients. The model already received float32 patches, so its inputs are unchanged apart from rounding. Predictions are written as float32 too.
Code, tests and README note are in separate commits.