mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-05 20:42:11 -07:00
AMP fix
This commit is contained in:
parent
11a7993238
commit
e52b53f87c
2 changed files with 4 additions and 10 deletions
|
@ -121,7 +121,7 @@ class AMPModel(ModelBase):
|
|||
def on_initialize(self):
|
||||
device_config = nn.getCurrentDeviceConfig()
|
||||
devices = device_config.devices
|
||||
self.model_data_format = "NCHW"# if len(devices) != 0 and not self.is_debug() else "NHWC"
|
||||
self.model_data_format = "NCHW"
|
||||
nn.initialize(data_format=self.model_data_format)
|
||||
tf = nn.tf
|
||||
|
||||
|
@ -262,8 +262,6 @@ class AMPModel(ModelBase):
|
|||
m = tf.nn.sigmoid(self.out_convm(m))
|
||||
return x, m
|
||||
|
||||
|
||||
|
||||
self.face_type = {'wf' : FaceType.WHOLE_FACE,
|
||||
'head' : FaceType.HEAD}[ self.options['face_type'] ]
|
||||
|
||||
|
@ -287,7 +285,6 @@ class AMPModel(ModelBase):
|
|||
if ct_mode == 'none':
|
||||
ct_mode = None
|
||||
|
||||
|
||||
models_opt_on_gpu = False if len(devices) == 0 else self.options['models_opt_on_gpu']
|
||||
models_opt_device = nn.tf_default_device_name if models_opt_on_gpu and self.is_training else '/CPU:0'
|
||||
optimizer_vars_on_cpu = models_opt_device=='/CPU:0'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue