Skip to content

Commit fae196e

Browse files
committed
Fix a bug in training loop
1 parent 036ca71 commit fae196e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

trainer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def _loss_fn(self, batch):
298298
data = batch[0].to(self.device)
299299
batch_size = data.size(0)
300300
clean_images = data
301-
labels = batch[1].to(self.device)
301+
labels = batch[1].to(self.device) if self.args.dataset == "imagenet" else None
302302

303303
timesteps = torch.randint(
304304
0, self.args.num_timesteps, (batch_size,), device=self.device

0 commit comments

Comments
 (0)