faceswap icon indicating copy to clipboard operation
faceswap copied to clipboard

I'm using GPU or CPU?

Open ByMark opened this issue 8 years ago • 3 comments

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

  • Operating system and version: Windows 10 64bits
  • Python version: 3.6.4 64bits
  • Faceswap version: last
  • Faceswap method: CPU/GPU?

pip freeze

  • bleach==1.5.0
  • click==6.7
  • cmake==0.9.0
  • cycler==0.10.0
  • decorator==4.2.1
  • dlib==19.9.0
  • enum34==1.1.6
  • face-recognition==1.2.1
  • face-recognition-models==0.3.0
  • h5py==2.7.1
  • html5lib==0.9999999
  • Keras==2.1.2
  • Markdown==2.6.11
  • matplotlib==2.1.2
  • networkx==2.1
  • numpy==1.14.0
  • opencv-python==3.3.0.10
  • pathlib==1.0.1
  • Pillow==5.0.0
  • protobuf==3.5.1
  • pyparsing==2.2.0
  • python-dateutil==2.6.1
  • pytz==2018.3
  • PyWavelets==0.5.2
  • PyYAML==3.12
  • scandir==1.6
  • scikit-image==0.13.1
  • scipy==1.0.0
  • six==1.11.0
  • tensorflow-gpu==1.4.0
  • tensorflow-tensorboard==0.4.0
  • tqdm==4.19.5
  • Werkzeug==0.14.1

ByMark avatar Feb 11 '18 02:02 ByMark

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.

3xtr3m3d avatar Feb 11 '18 06:02 3xtr3m3d

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 avatar Feb 11 '18 07:02 ByMark

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

ByMark avatar Feb 12 '18 19:02 ByMark