diff --git a/ldm/models/diffusion/ddpm.py b/ldm/models/diffusion/ddpm.py index bbedd04cf..dfeb6545e 100644 --- a/ldm/models/diffusion/ddpm.py +++ b/ldm/models/diffusion/ddpm.py @@ -1027,7 +1027,7 @@ def p_losses(self, x_start, cond, t, noise=None): loss_simple = self.get_loss(model_output, target, mean=False).mean([1, 2, 3]) loss_dict.update({f'{prefix}/loss_simple': loss_simple.mean()}) - logvar_t = self.logvar[t].to(self.device) + logvar_t = self.logvar.to(self.device)[t] loss = loss_simple / torch.exp(logvar_t) + logvar_t # loss = loss_simple / torch.exp(self.logvar) + self.logvar if self.learn_logvar: diff --git a/main.py b/main.py index e8e18c18f..b64ed0079 100644 --- a/main.py +++ b/main.py @@ -400,7 +400,7 @@ def on_train_epoch_start(self, trainer, pl_module): torch.cuda.synchronize(trainer.root_gpu) self.start_time = time.time() - def on_train_epoch_end(self, trainer, pl_module, outputs): + def on_train_epoch_end(self, trainer, pl_module): torch.cuda.synchronize(trainer.root_gpu) max_memory = torch.cuda.max_memory_allocated(trainer.root_gpu) / 2 ** 20 epoch_time = time.time() - self.start_time