We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 008b608 commit 60c384bCopy full SHA for 60c384b
examples/text_to_image/train_text_to_image.py
@@ -568,7 +568,7 @@ def collate_fn(examples):
568
569
# Predict the noise residual and compute loss
570
noise_pred = unet(noisy_latents, timesteps, encoder_hidden_states).sample
571
- loss = F.mse_loss(noise_pred, noise, reduction="mean")
+ loss = F.mse_loss(noise_pred.float(), noise.float(), reduction="mean")
572
573
# Gather the losses across all processes for logging (if we use distributed training).
574
avg_loss = accelerator.gather(loss.repeat(args.train_batch_size)).mean()
0 commit comments