-
I am working on a modified Radiology App of MONAI Label and a modified segmentation model. I'm frequently experiencing out of memory errors (x4 16GB ram GPUs). I found the best luck with To help debug these memory issues, I made a custom transform My question is what is the memory handling behavior of Any advice here? Thank you in advance. def train_pre_transforms(self, context: Context):
return [
LoadImaged(keys=("image", "label")),
EnsureChannelFirstd(keys=("image", "label")),
Spacingd(
keys=("image", "label"),
pixdim=self.target_spacing,
mode=("bilinear", "nearest"),
),
ScaleIntensityRanged(keys="image", a_min=-57, a_max=164, b_min=0.0, b_max=1.0, clip=True),
CropForegroundd(keys=("image", "label"), source_key="image"),
EnsureTyped(keys=("image", "label"), device=context.device),
RandCropByPosNegLabeld(
keys=("image", "label"),
label_key="label",
spatial_size=self.roi_size,
pos=1,
neg=1,
num_samples=4,
image_key="image",
image_threshold=0,
),
RandShiftIntensityd(keys="image", offsets=0.1, prob=0.5),
SelectItemsd(keys=("image", "label")),
Memoryd(keys=("image")),
] |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @bazorb, I think your understanding is right, maybe you could share a short piece of code to reproduce the problem you are pointing out and we can analyze it further. |
Beta Was this translation helpful? Give feedback.
-
Hi @bazorb , GPU usually has some memory pool mechanism that may not release a memory buffer immediately unless it will be OOM soon. So what your Thanks. |
Beta Was this translation helpful? Give feedback.
Hi @bazorb, I think your understanding is right, maybe you could share a short piece of code to reproduce the problem you are pointing out and we can analyze it further.
Thanks!