deepfakes / faceswap

Deepfakes Software For All
https://www.faceswap.dev
GNU General Public License v3.0
52.56k stars 13.24k forks source link

Task does not use GPU after a period of time (Apple Sillicon) #1242

Open Sora-dcliu opened 2 years ago

Sora-dcliu commented 2 years ago

Note: For general usage questions and help, please use either our FaceSwap Forum or FaceSwap Discord server. General usage questions are liable to be closed without response.

Crash reports MUST be included when reporting bugs.

Describe the bug In GUI, after training the model for about 1 hour,  The GPU usage becomes 0%, and the iteration is slow. But at the beginning of training, the GPU usage can reach about 90%. The computer didn't sleep and the monitor wasn't turned off.

To Reproduce Steps to reproduce the behavior:

  1. python faceswap.py gui
  2. choose input A B and model dir
  3. Click "Generate" and click "Train"

Expected behavior GPU can always work for training

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Crash Report The crash report generated in the root of your Faceswap folder

torzdf commented 2 years ago

I don't use Apple Silicon, but will leave this open in case any Apple Silicon users have any insights

Sora-dcliu commented 2 years ago

Correction: In fact, when running for about 3 hours and about 66500 iterations, the change stops using the GPU. And the program starts to get very slow.

geewiz94 commented 2 years ago

I have observed this as well, for there's a 50/50 chance for the GPU to stop during a training session. Sometimes it happens after 1 hour, sometimes I can train for 24 hours without issue, using the same model/settings. I'm not sure what the cause is, or how to find out..

torzdf commented 2 years ago

If I were to guess, I would suspect that this is some kind of internal throttling. This is most likely to be a Tensorflow/M1 issue rather than specifically Faceswap though. Possibly related: https://developer.apple.com/forums/thread/708154