Skip to content

Commit

Permalink
fix to work text encoder only network with bf16
Browse files Browse the repository at this point in the history
  • Loading branch information
kohya-ss committed Jul 22, 2023
1 parent 73a08c0 commit 8ba02ac
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions train_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ def train(self, args):
text_encoder, network, optimizer, train_dataloader, lr_scheduler
)
text_encoders = [text_encoder]

unet.to(accelerator.device, dtype=weight_dtype) # move to device because unet is not prepared by accelerator
else:
network, optimizer, train_dataloader, lr_scheduler = accelerator.prepare(
network, optimizer, train_dataloader, lr_scheduler
Expand Down

0 comments on commit 8ba02ac

Please sign in to comment.