Skip to content

Commit 0640f01

Browse files
authored
Merge pull request kohya-ss#1322 from aria1th/patch-1
Accelerate: fix get_trainable_params in controlnet-llite training
2 parents 2f19175 + 793aeb9 commit 0640f01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sdxl_train_control_net_lllite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ def remove_model(old_ckpt_name):
477477

478478
accelerator.backward(loss)
479479
if accelerator.sync_gradients and args.max_grad_norm != 0.0:
480-
params_to_clip = unet.get_trainable_params()
480+
params_to_clip = accelerator.unwrap_model(unet).get_trainable_params()
481481
accelerator.clip_grad_norm_(params_to_clip, args.max_grad_norm)
482482

483483
optimizer.step()

0 commit comments

Comments
 (0)