Commit Graph

182 Commits

Author SHA1 Message Date
Auroir c4e68ef539 Formatted Model Summary (#348)
* Formatted Model Summary

Aligns the model summary output using f-string formatting. The logic structure of the base class has not been changed, only the lines put into `model_summary_text`. Output width is calculated from keys & values and will scale to show a clean summary for any model/platform.

GPU VRAM has been added as an output. Incorrect detection of VRAM is possible in broken environments and GPUs of different sizes can report the same name. Showing it here adds clarity for the user and for issue tickets.

Concatenation changed from "\r\n" to "\n", CRLF end of lines for Windows are handled transparently so using it here caused extra blank lines in the summary txt file.

**Examples:**
Using CUDA + SAE-LIAE
```
============= Model Summary ==============
==                                      ==
==         Model name: SAE              ==
==                                      ==
==  Current iteration: 16               ==
==                                      ==
==----------- Model Options ------------==
==                                      ==
==         batch_size: 4                ==
==        sort_by_yaw: False            ==
==        random_flip: True             ==
==         resolution: 128              ==
==          face_type: f                ==
==         learn_mask: True             ==
==     optimizer_mode: 1                ==
==              archi: liae             ==
==            ae_dims: 256              ==
==          e_ch_dims: 42               ==
==          d_ch_dims: 21               ==
== multiscale_decoder: False            ==
==         ca_weights: False            ==
==         pixel_loss: False            ==
==   face_style_power: 0.0              ==
==     bg_style_power: 0.0              ==
==    apply_random_ct: False            ==
==           clipgrad: False            ==
==                                      ==
==------------- Running On -------------==
==                                      ==
==       Device index: 0                ==
==               Name: GeForce GTX 1080 ==
==               VRAM: 8.00GB           ==
==                                      ==
==========================================
```
Colab
```
========== Model Summary ==========
==                               ==
==         Model name: SAE       ==
==                               ==
==  Current iteration: 39822     ==
==                               ==
==-------- Model Options --------==
==                               ==
==         batch_size: 24        ==
==        sort_by_yaw: True      ==
==        random_flip: False     ==
==         resolution: 128       ==
==          face_type: f         ==
==         learn_mask: True      ==
==     optimizer_mode: 2         ==
==              archi: liae      ==
==            ae_dims: 222       ==
==          e_ch_dims: 34        ==
==          d_ch_dims: 16        ==
== multiscale_decoder: True      ==
==         ca_weights: True      ==
==         pixel_loss: False     ==
==   face_style_power: 2.0       ==
==     bg_style_power: 1.5       ==
==    apply_random_ct: False     ==
==           clipgrad: True      ==
==                               ==
==--------- Running On ----------==
==                               ==
==       Device index: 0         ==
==               Name: Tesla K80 ==
==               VRAM: 11.00GB   ==
==                               ==
===================================
```
Using OpenCL + H128
```
=========================== Model Summary ===========================
==                                                                 ==
==        Model name: H128                                         ==
==                                                                 ==
== Current iteration: 0                                            ==
==                                                                 ==
==------------------------- Model Options -------------------------==
==                                                                 ==
==        batch_size: 4                                            ==
==       sort_by_yaw: False                                        ==
==       random_flip: True                                         ==
==        lighter_ae: False                                        ==
==        pixel_loss: False                                        ==
==                                                                 ==
==-------------------------- Running On ---------------------------==
==                                                                 ==
==      Device index: 0                                            ==
==              Name: Advanced Micro Devices, Inc. gfx900 (OpenCL) ==
==              VRAM: 7.98GB                                       ==
==                                                                 ==
=====================================================================
```
Using CPU (output trimmed)
```
==------- Running On --------==
==                           ==
==       Using device: CPU   ==
==                           ==
===============================
```
multi_gpu support is retained (output trimmed)
```
==------------- Running On -------------==
==                                      ==
==    Using multi_gpu: True             ==
==                                      ==
==       Device index: 1                ==
==               Name: Geforce GTX 1080 ==
==               VRAM: 8.00GB           ==
==       Device index: 2                ==
==               Name: Geforce GTX 1080 ==
==               VRAM: 8.00GB           ==
==                                      ==
==========================================
```

Low VRAM warning (output trimmed)
```
==------------- Running On -------------==
==                                      ==
==       Device index: 0                ==
==               Name: Geforce GTX 1050 ==
==               VRAM: 2.00GB           ==
==                                      ==
==========================================
/!\
/!\ WARNING:
/!\ You are using a GPU with 2GB or less VRAM. This may significantly reduce the quality of your result!
/!\ If training does not start, close all programs and try again.
/!\ Also you can disable Windows Aero Desktop to increase available VRAM.
/!\
```

* Fix indent
2019-08-16 18:35:27 +04:00
iperov e8c5f168bd Merge branch 'master' of https://github.com/iperov/DeepFaceLab 2019-08-11 11:17:38 +04:00
iperov b72d5a3f9a fixed error "Failed to get convolution algorithm" on some systems
fixed error "dll load failed" on some systems
Expanded eyebrows line of face masks. It does not affect mask of FAN-x converter mode.
2019-08-11 11:17:22 +04:00
Josh Johnson e2bc65d5f0 Fix issue with RTX GPU and TensorFlow (#322)
An issue affecting at least 2070 and 2080 cards (possibly other RTX cards too) requires auto growth to be enabled for TensorFlow to work.

I don't know enough about the impact of this change to know whether this ought to be made optional or not, but for RTX owners, this simple change fixes TensorFlow errors when generating models.
2019-08-02 16:40:41 +04:00
fakerdaker 582c974851 Colab choose random preview (#316) 2019-07-25 11:29:31 +04:00
iperov 8484060e01 Trainer: added option for all models
Enable autobackup? (y/n ?:help skip:%s) :
Autobackup model files with preview every hour for last 15 hours. Latest backup located in model/<>_autobackups/01

SAE: added option only for CUDA builds:
Enable gradient clipping? (y/n, ?:help skip:%s) :
Gradient clipping reduces chance of model collapse, sacrificing speed of training.
2019-06-20 10:42:55 +04:00
Jakob6174 ea1d59f620 Update ModelBase.py (#283)
Typo: 'NotImplementeError' --> 'NotImplementedError'
2019-06-19 13:02:19 +04:00
iperov 66a12a973a fix choosing preview image on options override 2019-05-14 17:00:25 +04:00
iperov d6e8dde481 'sort by yaw' option now can be overriden each run 2019-05-14 09:33:53 +04:00
iperov 39809ff7dc upd 2019-05-11 16:15:16 +04:00
iperov 6143962248 SAE: option apply_random_ct now True by default 2019-05-10 19:50:19 +04:00
iperov 5a9498543d refactoring 2019-05-09 18:05:50 +04:00
iperov d2011f8c32 upd doc 2019-05-08 09:32:32 +04:00
iperov d8c1e2e58b change help for apply_random_ct option 2019-05-07 10:47:29 +04:00
iperov a805f81142 SAE: added test option: 'Apply random color transfer to src faceset' 2019-05-06 11:34:56 +04:00
iperov f26267fddf sae: upd help 2019-05-02 09:06:22 +04:00
iperov 54fa75aa13 fix 2019-05-02 00:39:18 +04:00
iperov 6dc1d43fe9 fix 2019-05-01 20:03:15 +04:00
iperov 9577c2d254 fix 2019-05-01 19:59:43 +04:00
iperov 2a8dd788dc SAE: added option 'Pretrain the model?',
Pretrain the model with large amount of various faces. This technique may help to train the fake with overly different face shapes and light conditions of src/dst data. Face will be look more like a morphed. To reduce the morph effect, some model files will be initialized but not be updated after pretrain: LIAE: inter_AB.h5 DF: both decoders.h5. The longer you pretrain the model the more morphed face will look. After that, save and run the training again.
2019-05-01 19:55:27 +04:00
iperov 659aa5705a _ 2019-04-30 17:14:02 +04:00
iperov efb22ecce0 5 secs for override settings for colab 2019-04-30 07:32:15 +04:00
iperov 2cd028fb67 _ 2019-04-28 21:16:27 +04:00
iperov 836693d64f added option 'Choose image for the preview history? (y/n skip:' 2019-04-27 10:03:54 +04:00
iperov 9e05e58ac4 _ 2019-04-26 21:43:43 +04:00
iperov 0e088f6415 _ 2019-04-25 14:46:39 +04:00
iperov 9535a657d2 SAE: revert back CA weights option 2019-04-24 13:44:12 +04:00
iperov b6711b97a3 SAE added CA weights 2019-04-24 11:38:45 +04:00
iperov 947feac047 refactorings 2019-04-24 11:28:58 +04:00
iperov e1da9c56b4 SAE collapse fix (#245)
* test

* _

* _

* upd dev_poseest

* SAE: finally collapses are fixed

* fix batch size help
2019-04-24 09:38:26 +04:00
iperov d62785ca5a _ 2019-04-24 00:36:09 +04:00
iperov 747e39145e _ 2019-04-23 18:34:00 +04:00
iperov ea7ec74721 change help for batch size 2019-04-23 18:31:12 +04:00
iperov 385d5dabbf remove df-s and liae-s 2019-04-23 18:28:17 +04:00
iperov 2809d495c2 _ 2019-04-23 17:31:58 +04:00
iperov 268b402513 _ 2019-04-23 17:03:53 +04:00
iperov 47f9bad42b SAE: df-s liae-s archis 2019-04-23 17:03:30 +04:00
iperov 8969e80275 _ 2019-04-23 14:07:38 +04:00
iperov 565c131b97 SAE: removed option 'remove gray border', because it makes the model very resource intensive 2019-04-23 08:31:13 +04:00
iperov e58197ca22 initial code to extract umdfaces.io dataset and train pose estimator 2019-04-23 08:14:09 +04:00
iperov 51a917facc back to 100* loss 2019-04-22 10:42:17 +04:00
iperov cd2767cca0 SAE: back to batchnormalization 2019-04-22 10:28:01 +04:00
iperov 3aef9a507b fix 2019-04-22 00:52:16 +04:00
iperov 44aa530fda multiple preview file support for colab 2019-04-22 00:49:50 +04:00
iperov f54cc744bd SAE fix model crashes 2019-04-22 00:40:23 +04:00
iperov 5e3bd75007 fix 2019-04-21 22:28:25 +04:00
iperov 16053c4ae6 SAE: revert back to batchnormalization 2019-04-21 22:17:41 +04:00
iperov 093ca4dba6 fix options in ModelBase.py 2019-04-21 21:08:45 +04:00
iperov 63beb3afd2 SAE: revert back df model from prev commit. LIAE should be restarted. 2019-04-21 08:31:05 +04:00
iperov 2cdf2745a2 SAE: model will not work with this update, you should to restart training,
applied paper https://arxiv.org/abs/1807.01442 https://github.com/aditya-grover/uae
2019-04-20 22:33:28 +04:00