PSPNet
PSPNet copied to clipboard
Bug in eval_all.m
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.)
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.
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.