LabelSampler Memory Consumption
See original GitHub issueHi All, I am using Label Sampler as follows:
psize = (144,144,80)
sampler = torchio.data.LabelSampler(psize)
patches_queue = torchio.Queue(subjects_dataset, max_length=1,
samples_per_volume=1,
sampler=sampler, num_workers=4,
shuffle_subjects=False, shuffle_patches=True, verbose=False)
The LabelSampler
seems to consume CPU memory upwards of 120GB. I have 160ish training images. I am using about 6 augmentations with probability = 0.1
.
However, when I use the exact same configuration, but with UniformSampler
, the CPU memory requirement is much lesser.
Any reason this is happening? Thanks for your help, Megh
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Patch samplers - Training - TorchIO
Samplers are used to randomly extract patches from volumes. They are called with a sample generated by a SubjectsDataset and return a Python...
Read more >Memory Consumption of DistributedSampler too large when ...
use DistributedSampler as its sampler; it could be find that .tolist() operation would cause many times of memory than original torch.Tensor ...
Read more >DistributedSampler memory consumption in PyTorch 0.4.0
At runtime each memory consumption is about 8G, when training on single GPUs, single machine; And each memory consumption has increased from ...
Read more >Stream felte | Listen to felte (Label Sampler) playlist online for free ...
Listen to felte (Label Sampler), a playlist curated by felte on desktop and mobile. ... Public Memory - Lunar (The Sight Below Remix)....
Read more >Just A Memory | Endangered Species - V4 Visions - Bandcamp
Just A Memory by Endangered Species, released 01 February 2021.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks a lot @fepegar for your detailed analysis.
I observed one thing. When I am doing padding for
LabelSampler
andWeightedSampler
as per our discussion here: https://github.com/fepegar/torchio/issues/392 - like this:By doing this padding I observed that the memory requirement shoots up by a lot (>125GB). I am trying to investigate what the issue might be. Thanks again, Megh
Thank you @fepegar. Sure, I will try using
WeightedSampler
and let you know. Will try making a dummy dataset and let you know. Thanks again