matlab-deep-learning / mtcnn-face-detection

Face detection and alignment using deep learning
Other
26 stars 18 forks source link

gpu option fails #20

Closed mattrussell2 closed 3 years ago

mattrussell2 commented 3 years ago

Hi!

When initializing with gpu on, I get the following error:

"The input bbox and score must both be gpuArray objects."

I think the problem is on line 162 in Detector.m

[bboxes, scores, index] = selectStrongestBbox(gather(bboxes), scores, ... "RatioType", "Min", ... "OverlapThreshold", obj.NmsThresholds(netIdx));

changing 'gather(bboxes)' to just 'bboxes' fixes the issue for me.

Thanks, Matt

PS: this is without DagNet on

justinpinkney commented 3 years ago

Ok looks like this is because selectStrongestBbox got gpuArray support in MATLAB R2020b. Previously the gather was required if bboxes was gpuArray and needed to be on the cpu (strangely the scores didn't matter).

In R2020b they need to be the same either both on the gpu or not.