mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
Revert loss scale for ipex
This commit is contained in:
@@ -654,11 +654,9 @@ def train_hypernetwork(id_task, hypernetwork_name, learn_rate, batch_size, gradi
|
||||
loss = shared.sd_model.forward(x, c)[0] / gradient_step
|
||||
del x
|
||||
del c
|
||||
if shared.cmd_opts.use_ipex and loss > (1 / gradient_step):
|
||||
loss = (loss - (1 / gradient_step)) * 10
|
||||
_loss_step += loss.item()
|
||||
scaler.scale(loss).backward()
|
||||
|
||||
scaler.scale(loss).backward()
|
||||
# go back until we reach gradient accumulation steps
|
||||
if (j + 1) % gradient_step != 0:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user