I have a problem with loading ImageNet data. I want to extract features from the images and save them in a matrix (# of images, feature size). My GPU is Nvidia Quadro RTX 6000 with 24 GB ram. I get a “cuda out of memory” error when I run my code.
I tried to fix it by doing these things:
- lowering the batch size (from 256 to 4) and the number of workers (from 8 to 2)
- setting max_split_size_mb =2
- clearing the cache and deleting unused variables
But none of them worked. How can I solve this problem? Did I make any mistakes?