teticio commited on
Commit
399a445
1 Parent(s): f15cb42

fix progress bar

Browse files
.gitignore CHANGED
@@ -10,3 +10,4 @@ lightning_logs
10
  taming
11
  checkpoints
12
  vae_model
 
 
10
  taming
11
  checkpoints
12
  vae_model
13
+ latent-audio-diffusion-*
notebooks/test_vae.ipynb CHANGED
The diff for this file is too large to render. See raw diff
 
scripts/train_unconditional.py CHANGED
@@ -48,7 +48,8 @@ def main(args):
48
  model = DDPMPipeline.from_pretrained(args.from_pretrained).unet
49
  else:
50
  model = UNet2DModel(
51
- sample_size=args.resolution if args.vae is None else 64,
 
52
  in_channels=1 if args.vae is None else 3,
53
  out_channels=1 if args.vae is None else 3,
54
  layers_per_block=2,
@@ -211,9 +212,8 @@ def main(args):
211
  ema_model.step(model)
212
  optimizer.zero_grad()
213
 
214
- if accelerator.sync_gradients:
215
- progress_bar.update(1)
216
- global_step += 1
217
 
218
  logs = {
219
  "loss": loss.detach().item(),
@@ -304,7 +304,8 @@ if __name__ == "__main__":
304
  parser.add_argument("--output_dir", type=str, default="ddpm-model-64")
305
  parser.add_argument("--overwrite_output_dir", type=bool, default=False)
306
  parser.add_argument("--cache_dir", type=str, default=None)
307
- parser.add_argument("--resolution", type=int, default=64)
 
308
  parser.add_argument("--train_batch_size", type=int, default=16)
309
  parser.add_argument("--eval_batch_size", type=int, default=16)
310
  parser.add_argument("--num_epochs", type=int, default=100)
 
48
  model = DDPMPipeline.from_pretrained(args.from_pretrained).unet
49
  else:
50
  model = UNet2DModel(
51
+ sample_size=args.resolution
52
+ if args.vae is None else args.latent_resolution,
53
  in_channels=1 if args.vae is None else 3,
54
  out_channels=1 if args.vae is None else 3,
55
  layers_per_block=2,
 
212
  ema_model.step(model)
213
  optimizer.zero_grad()
214
 
215
+ progress_bar.update(1)
216
+ global_step += 1
 
217
 
218
  logs = {
219
  "loss": loss.detach().item(),
 
304
  parser.add_argument("--output_dir", type=str, default="ddpm-model-64")
305
  parser.add_argument("--overwrite_output_dir", type=bool, default=False)
306
  parser.add_argument("--cache_dir", type=str, default=None)
307
+ parser.add_argument("--resolution", type=int, default=256)
308
+ parser.add_argument("--latent_resolution", type=int, default=64)
309
  parser.add_argument("--train_batch_size", type=int, default=16)
310
  parser.add_argument("--eval_batch_size", type=int, default=16)
311
  parser.add_argument("--num_epochs", type=int, default=100)
scripts/train_vae.py CHANGED
@@ -3,7 +3,6 @@
3
  # convert_original_stable_diffusion_to_diffusers.py
4
 
5
  # TODO
6
- # add latent resolution as parameter
7
  # grayscale
8
  # update README
9
 
 
3
  # convert_original_stable_diffusion_to_diffusers.py
4
 
5
  # TODO
 
6
  # grayscale
7
  # update README
8