matlab-deep-learning / mtcnn-face-detection

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

Detection with UseGPU=true and UseDagNet=true fails due to gpuArray image. #12

Closed msprog closed 4 years ago

msprog commented 4 years ago

Hey Justin I Pass the same image you use, I didn't change any thing in your code just adding the UseGPU, as in the attached image. when I try to use "UseGPU",true I got this error 'Error using DAGNetwork/createDispatcher (line 329) Image data must be single image, a 4-D array of images,an image datastore, or a MiniBatchable datastore' How to fix this plz.

justinpinkney commented 4 years ago

OK I think I might know what's going on here. Using UseGPU true and the UseDagNet true will fail with the error above.

This is because for the dlarray version the image is converted to a gpuArray, but this won't work when using a DAG net. This should be a fairly straightforward fix, so shouldn't take me too long to put up a patch.

msprog commented 4 years ago

OK I think I might know what's going on here. Using UseGPU true and the UseDagNet true will fail with the error above.

This is because for the dlarray version the image is converted to a gpuArray, but this won't work when using a DAG net. This should be a fairly straightforward fix, so shouldn't take me too long to put up a patch.

### Thank you a lot for fast replay, I will wait for your correction.

msprog commented 4 years ago

Hey Justin, Do you make any changes to the "mtcnn toolbox" because you didn't upload it with the fixed files and there is this error this time "undefined function or variable dlupdate" thank you again and hope you will help me in this

justinpinkney commented 4 years ago

Yes I have made a fix but haven't generated the new mltbx to release yet. I want to do a few more checks first.

I've also realised that the original way you were using this with UseGPU set to false and in R2019a (I'm guessing) was already using the GPU. The default behaviour of the DAGNetwork was to automatically use the GPU if present. My UseGPU option was just broken, so you won't see any speed increase using my fix as a you're already using the GPU!

If you want better performance then I'd suggest upgrading to R2019b or later, I've found this to be about 5x faster (somewhat surprisingly)

msprog commented 4 years ago

OK, thank you very much justin, i will upgrade my matlab.