PSPNet icon indicating copy to clipboard operation
PSPNet copied to clipboard

Bug in eval_all.m

Open askerlee opened this issue 7 years ago • 2 comments

eval_all.m assumes there are 4 GPUs on the user's PC. However when there are < 4 GPUs, matcaffe will crash. At line 61: gpu_id_array=[0:3]; %multi-GPUs for parfor testing The array should be set according to the number of GPUs of the user's machine. (This bug cost me almost a day to spot, because caffe's log is suppressed, and the workers run in parallel. Therefore I can only guess where it goes wrong, and insert a lot of disp to trace the crash point.)

askerlee avatar Dec 07 '16 13:12 askerlee

I switched it to gpu_id_array=[0:0] that does the trick. However, the indexing does not work if you pass in a list of images to segment that is not as bis as steps. I switched the loop in eval_sub to: for i = 1:numel(list); Since I only have on GPU, it doesn't really matter how they are divided.

RunOrVeith avatar Dec 07 '16 14:12 RunOrVeith

Hi, We assume that number of images can be divided by number of GPUs; if not, you can just pad your image list or switch to single GPU evaluation by set 'gpu_id_array' be length of one, and change 'parfor' to 'for' loop. Thanks.

hszhao avatar Dec 08 '16 10:12 hszhao