PSPNet icon indicating copy to clipboard operation
PSPNet copied to clipboard

Not enough memory

Open hungnguyen0606 opened this issue 8 years ago • 6 comments

Thanks to yifan254 & mjohn123, I'm finally able to run "run.sh". However, the memory of my gpu is not big enough for the model. Is there anyway to reduce the size of the model or size of the data used for evaluation. Here is my configuration:

case 'VOC2012' isVal = false; %evaluation on testset step = 364; %=1456/4 data_root = '/home/ubuntu16/my_user/workspace/thesis/Framework/PSPNet-segmentation/data/test/VOCdevkit/VOC2012'; eval_list = 'samplelist/VOC2012_test.txt'; save_root = 'mc_result/VOC2012/test/pspnet101_473/'; model_weights = 'model/pspnet101_VOC2012.caffemodel'; model_deploy = 'prototxt/pspnet101_VOC2012_473.prototxt'; fea_cha = 21; base_size = 512; crop_size = 473; data_class = 'objectName21.mat'; data_colormap = 'colormapvoc.mat';

hungnguyen0606 avatar Dec 27 '16 15:12 hungnguyen0606

I believe evaluation @ 473 resolution consumes < 12gb memory

If you don't have a gpu of 12gb memory, maybe you can further reduce resolution to ~300 (like 321)

remember to modify conv5_3_pool1/2/3/6_interp accordingly

since pascal images are typically 513 resolution and this model is trained under 0.5 resolution data augmentation (according to the paper) that's around 256 resolution so i guess evaluating @ ~ 300 resolution still works. (with some performance losses).

Fromandto avatar Dec 28 '16 02:12 Fromandto

@Fromandto How to modify conv5_3_pool1/2/3/6_interp with a new size? such as 640?

rener1199 avatar Dec 28 '16 03:12 rener1199

@rener1199

if input resolution is 473, then conv5_3_pool1/2/3/6_interp resolution is 60

60 * 8 = 480 ~= 473

that's the rule (with 7 pixels mismatch caused by padding/striding)

640 / 8 = 80 means conv5_3_pool1/2/3/6_interp should be 80 (or 81/82/79/78 depending on your network padding/striding)

Fromandto avatar Dec 28 '16 04:12 Fromandto

Hi every body, I tried to run the code eval_all.m on a GPU with 3 GB of memory but I encountered "Out of memory error". Did anyone run the code successfully? If the answer is yes, please explain the the steps and minimum required hardware. If there is a way to run the code on a GPU with 3GB memory, successfully, I would appreciate if you let me know.

SMMohammadi avatar Feb 28 '17 08:02 SMMohammadi

@rener1199 If the crop size is N = 8x + 1, then conv5_3_pool1/2/3/6_interp would need to be set at x, for the model to run out of the box.

ishann avatar Jul 01 '17 06:07 ishann

a GPU with 8 GB of memory , GTX 1070 , is it enough memory to run test ?

AI-liu avatar Sep 24 '17 03:09 AI-liu