denoising-diffusion-pytorch icon indicating copy to clipboard operation
denoising-diffusion-pytorch copied to clipboard

I keep running out of memory when running GaussianDiffusion1D. Is there a way to change the batch size?

Open RainbowPiBubbles opened this issue 1 year ago • 1 comments

model = Unet1D( dim = 64, dim_mults = (1, 2, 4, 8), channels = 1, )

diffusion = GaussianDiffusion1D( model, seq_length = 128, timesteps = 250, objective = 'pred_v', )

training_seq = tenenc

loss = diffusion(training_seq) #Has a shape of (1200, 1, 128) loss.backward()

#after a lot of training

sampled_seq = diffusion.sample(batch_size = 1) sampled_seq.shape # (1, 1, 128)

RainbowPiBubbles avatar Apr 08 '23 22:04 RainbowPiBubbles

The Trainer Class has the attribute "train_batch_size". You can simply pass the batch_size you want.

Adrian744 avatar Jun 03 '23 19:06 Adrian744