Skip to content

Commit

Permalink
Merge pull request kohya-ss#1322 from aria1th/patch-1
Browse files Browse the repository at this point in the history
Accelerate: fix get_trainable_params in controlnet-llite training
  • Loading branch information
kohya-ss authored May 19, 2024
2 parents 2f19175 + 793aeb9 commit 0640f01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sdxl_train_control_net_lllite.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def remove_model(old_ckpt_name):

accelerator.backward(loss)
if accelerator.sync_gradients and args.max_grad_norm != 0.0:
params_to_clip = unet.get_trainable_params()
params_to_clip = accelerator.unwrap_model(unet).get_trainable_params()
accelerator.clip_grad_norm_(params_to_clip, args.max_grad_norm)

optimizer.step()
Expand Down

0 comments on commit 0640f01

Please sign in to comment.