deepfakes / faceswap

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

I'm using GPU or CPU? #175

Closed ByMark closed 6 years ago

ByMark commented 6 years ago

When I run a faceswap.py train my CPU load is 80% but my GPU only 40% using Original or 20% using GAN (Maybe this is normal not sure).

Did't notice this until I tried to faceswap.py extract using CNN with a extreme low speed and see how CPU load at 70% and 0% at GPU.

Now not sure if I'm using GPU or CPU to all the proccess but for sure is using CPU for CNN extract.

I read some issues related to this with no success and installed pip install -r requirements-gpu.txt

Train output

Model A Directory: D:\data\a Model B Directory: D:\data\b Training data directory: D:\models Loading data, this may take a while... Using live preview Loading Model from Model_GAN plugin... D:\faceswap_env\lib\site-packages\h5py__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters Using TensorFlow backend. 2018-02-10 23:04:55.612891: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX 2018-02-10 23:04:55.872553: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:1030] Found device 0 with properties: name: GeForce GTX 1060 6GB major: 6 minor: 1 memoryClockRate(GHz): 1.7845 pciBusID: 0000:02:00.0 totalMemory: 6.00GiB freeMemory: 4.97GiB 2018-02-10 23:04:55.872731: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: GeForce GTX 1060 6GB, pci bus id: 0000:02:00.0, compute capability: 6.1) Discriminator models loaded. Generator models loaded. Loading Trainer from Model_GAN plugin... Starting. Press "Enter" to stop training and save model Models saved./num_epochs][0] Loss_DA: 0.252021 Loss_DB: 0.252227 Loss_GA: 0.196300 Loss_GB: 0.203621 Models saved.01/num_epochs][100] Loss_DA: 0.204054 Loss_DB: 0.204225 Loss_GA: 0.202367 Loss_GB: 0.213733 [23:07:38] [151/num_epochs][149] Loss_DA: 0.250163 Loss_DB: 0.250467 Loss_GA: 0.197065 Loss_GB: 0.2063

System info

pip freeze

3xtr3m3d commented 6 years ago

for me even though GPU is showing 10% on task manager, GPU compute_0 is 100%. looks like cpu is mainly used for preview windows. once the preview windows off , cpu is using around 30% load.

ByMark commented 6 years ago

Your right, in Task Manager GPU load is showing below 20% but Dedicate GPU memory usage is full.

For sure CNN work only with CPU is so slow just for a few images...

ByMark commented 6 years ago

Solved at https://github.com/deepfakes/faceswap/issues/184