From e89165b2a03fad2716ba24bcaacf1e6f24830d6d Mon Sep 17 00:00:00 2001 From: Silky Singh <54901747+silky1708@users.noreply.github.com> Date: Thu, 16 May 2024 17:54:42 +0530 Subject: [PATCH 1/2] Update ddpm.py first move `self.logvar` to `self.device`, and then index on line 1030 --- ldm/models/diffusion/ddpm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: From 3cb10652e315de26ac2d56d5f862ff0bf510d2c3 Mon Sep 17 00:00:00 2001 From: Silky Singh <54901747+silky1708@users.noreply.github.com> Date: Thu, 16 May 2024 18:10:37 +0530 Subject: [PATCH 2/2] Fix TypeError in main.py remove extraneous argument outputs (L403, main.py) --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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