-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
train_StyleGAN2_256_Cmul2_FFHQ.yml
101 lines (85 loc) · 1.74 KB
/
train_StyleGAN2_256_Cmul2_FFHQ.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# general settings
name: 501_StyleGAN2_256_Cmul2_FFHQ_800k_B24G8_scratch
model_type: StyleGAN2Model
num_gpu: 8 # set num_gpu: 0 for cpu mode
manual_seed: 0
# dataset and data loader settings
datasets:
train:
name: FFHQ
type: FFHQDataset
dataroot_gt: datasets/ffhq/ffhq_256.lmdb
io_backend:
type: lmdb
use_hflip: true
mean: [0.5, 0.5, 0.5]
std: [0.5, 0.5, 0.5]
# data loader
num_worker_per_gpu: 6
batch_size_per_gpu: 3
dataset_enlarge_ratio: 100
prefetch_mode: ~
# network structures
network_g:
type: StyleGAN2Generator
out_size: 256
num_style_feat: 512
num_mlp: 8
channel_multiplier: 2
resample_kernel: [1, 3, 3, 1]
lr_mlp: 0.01
network_d:
type: StyleGAN2Discriminator
out_size: 256
channel_multiplier: 2
resample_kernel: [1, 3, 3, 1]
# path
path:
pretrain_network_g: ~
strict_load_g: true
resume_state: ~
# training settings
train:
optim_g:
type: Adam
lr: !!float 2e-3
optim_d:
type: Adam
lr: !!float 2e-3
scheduler:
type: MultiStepLR
milestones: [600000]
gamma: 0.5
total_iter: 800000
warmup_iter: -1 # no warm up
# losses
gan_opt:
type: GANLoss
gan_type: wgan_softplus
loss_weight: !!float 1
# r1 regularization for discriminator
r1_reg_weight: 10
# path length regularization for generator
path_batch_shrink: 2
path_reg_weight: 2
net_g_reg_every: 4
net_d_reg_every: 16
mixing_prob: 0.9
net_d_iters: 1
net_d_init_iters: 0
# validation settings
val:
val_freq: !!float 5e3
save_img: true
# logging settings
logger:
print_freq: 100
save_checkpoint_freq: !!float 5e3
use_tb_logger: true
wandb:
project: ~
resume_id: ~
# dist training settings
dist_params:
backend: nccl
port: 29500