|
27 | 27 | torch.backends.cudnn.benchmark = False # NR: True is a bit faster, but can lead to OOM. False is more deterministic.
|
28 | 28 | #torch.use_deterministic_algorithms(True) # NR: grid_sampler_2d_backward_cuda does not have a deterministic implementation
|
29 | 29 |
|
30 |
| -from torch_optimizer import DiffGrad, AdamP, RAdam |
| 30 | +from torch_optimizer import DiffGrad, AdamP |
31 | 31 |
|
32 | 32 | from CLIP import clip
|
33 | 33 | import kornia.augmentation as K
|
|
50 | 50 | if not torch.cuda.is_available():
|
51 | 51 | default_image_size = 256 # no GPU found
|
52 | 52 | elif get_device_properties(0).total_memory <= 2 ** 33: # 2 ** 33 = 8,589,934,592 bytes = 8 GB
|
53 |
| - default_image_size = 318 # <8GB VRAM |
| 53 | + default_image_size = 304 # <8GB VRAM |
54 | 54 |
|
55 | 55 | # Create the parser
|
56 | 56 | vq_parser = argparse.ArgumentParser(description='Image generation using VQGAN+CLIP')
|
|
75 | 75 | vq_parser.add_argument("-cutp", "--cut_power", type=float, help="Cut power", default=1., dest='cut_pow')
|
76 | 76 | vq_parser.add_argument("-sd", "--seed", type=int, help="Seed", default=None, dest='seed')
|
77 | 77 | vq_parser.add_argument("-opt", "--optimiser", type=str, help="Optimiser", choices=['Adam','AdamW','Adagrad','Adamax','DiffGrad','AdamP','RAdam','RMSprop'], default='Adam', dest='optimiser')
|
78 |
| -vq_parser.add_argument("-o", "--output", type=str, help="Output filename", default="output.png", dest='output') |
| 78 | +vq_parser.add_argument("-o", "--output", type=str, help="Output image filename", default="output.png", dest='output') |
79 | 79 | vq_parser.add_argument("-vid", "--video", action='store_true', help="Create video frames?", dest='make_video')
|
80 | 80 | vq_parser.add_argument("-zvid", "--zoom_video", action='store_true', help="Create zoom video?", dest='make_zoom_video')
|
81 | 81 | vq_parser.add_argument("-zs", "--zoom_start", type=int, help="Zoom start iteration", default=0, dest='zoom_start')
|
@@ -663,7 +663,7 @@ def get_opt(opt_name, opt_lr):
|
663 | 663 | elif opt_name == "AdamP":
|
664 | 664 | opt = AdamP([z], lr=opt_lr)
|
665 | 665 | elif opt_name == "RAdam":
|
666 |
| - opt = RAdam([z], lr=opt_lr) |
| 666 | + opt = optim.RAdam([z], lr=opt_lr) |
667 | 667 | elif opt_name == "RMSprop":
|
668 | 668 | opt = optim.RMSprop([z], lr=opt_lr)
|
669 | 669 | else:
|
|
0 commit comments