Skip to content

Commit c0d50e6

Browse files
committed
fixed a bug: the stride of the last two discriminator layers should be 1
1 parent 29f7c10 commit c0d50e6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

models/networks/discriminator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ def __init__(self, opt):
8787
for n in range(1, opt.n_layers_D):
8888
nf_prev = nf
8989
nf = min(nf * 2, 512)
90+
stride = 1 if n == opt.n_layers_D - 1 else 2
9091
sequence += [[norm_layer(nn.Conv2d(nf_prev, nf, kernel_size=kw,
91-
stride=2, padding=padw)),
92+
stride=stride, padding=padw)),
9293
nn.LeakyReLU(0.2, False)
9394
]]
9495

0 commit comments

Comments
 (0)