faceswap icon indicating copy to clipboard operation
faceswap copied to clipboard

CNN detector memory issue

Open Deadfishzzway opened this issue 8 years ago • 4 comments

CNN detector

Expected behavior

I used the cnn detector for extract, no issue , lots more faces were extracted. However when I use this detector while converting,I got lots of error message saying Reason: Error while calling cudaGetLastError() in file C:\Users\weichen\AppData\Local\Temp\pip-build-bevzw7aj\dlib\dlib\dnn\gpu_data.cpp:91. code: 2, reason: out of memory And I get 0 face align\converted. I have GTX 980 with 3.27 GB of free VRAM. I then tried the detector on a google vm with Tesla K80 which have 11GB ish VRAM. Still I got the same Error

Thought\Question

Maybe because tensorflow grab all available VRAM by default and making any other VRAM intensive process non-available? Can I seperate the process so cnn run before actual convert happens? If that is not the cause, what did I do wrong?

Steps to reproduce

python faceswap.py convert -D cnn

Other relevant information

  • Operating system and version: Windows 10 64
  • Python version: 3.6.4
  • Faceswap version: 809dfc20f822840c08ccf0546382b0aa70443a3e
  • Faceswap method: GPU GTX980 / Tesla K80

Deadfishzzway avatar Feb 13 '18 18:02 Deadfishzzway

What's the size of the image you're trying to convert?

ppmdo avatar Feb 14 '18 02:02 ppmdo

1280*720 png bit depth 24 each is around 1MB

Deadfishzzway avatar Feb 14 '18 02:02 Deadfishzzway

So I tried using the cnn extract command first to generate the alignment.json file. Then when I use the convert -D cnn command, it convert all the faces. with a line saying Reading alignments from ***/test5/alignment.json before it started converting.

Deadfishzzway avatar Feb 14 '18 03:02 Deadfishzzway

And does it work now? Please reopen in faceswap-playground if still relevant. Thanks

Clorr avatar Feb 14 '18 15:02 Clorr