sub batching volumetric images to subvolumes for segmentation #13836
Unanswered
Jason-Fung
asked this question in
code help: CV
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm new to the pytorch lightning API and its community, and I've been trying to figure out a way to refactor my original code to train a unet using MONAI for 3D volumetric image segmentation. One problem I encountered was figuring out a way to control the training of batches of subvolumes from a full image to avoid OOM issues. Looking at the pseudocode for DataParallel from this link: https://pytorch-lightning.readthedocs.io/en/stable/common/lightning_module.html#training-with-dataparallel
I thought it would be a good idea to override the tbptt_split_batch function with my own implementation.
def tbptt_split_batch(self, batch):
Since my images have varying with even/odd stack sizes i.e., 34, 71, 85, etc. the strategy is to split the image into an upper volume (z_given % z_upper_volume == 0) and lower volumes (remainder stacks) then patching the upper volume and lower volumes into 3d patches i.e., (16,160,160).
I'm just wondering if this is the correct function to override if I want to do subvolume batch training?
Beta Was this translation helpful? Give feedback.
All reactions