Skip to content

Commit c74e436

Browse files
committed
make sure contrastive loss regularization and transparent images are not both turned on
1 parent 7d0af67 commit c74e436

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name = 'stylegan2_pytorch',
55
packages = find_packages(),
66
scripts=['bin/stylegan2_pytorch'],
7-
version = '0.16.1',
7+
version = '0.16.2',
88
license='GPLv3+',
99
description = 'StyleGan2 in Pytorch',
1010
author = 'Phil Wang',

stylegan2_pytorch/stylegan2_pytorch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@ def __init__(self, image_size, latent_dim = 512, style_depth = 8, network_capaci
529529
self.GE = Generator(image_size, latent_dim, network_capacity, transparent = transparent, attn_layers = attn_layers, no_const = no_const)
530530

531531
# experimental contrastive loss discriminator regularization
532+
assert not (transparent and cl_reg), 'contrastive loss regularization does not work with transparent images yet'
532533
self.D_cl = ContrastiveLearner(self.D, image_size, hidden_layer='flatten') if cl_reg else None
533534

534535
# wrapper for augmenting all images going into the discriminator

0 commit comments

Comments
 (0)