crcrpar / pytorch.sngan_projection Goto Github PK
View Code? Open in Web Editor NEWAn unofficial PyTorch implementation of SNGAN (ICLR 2018) and cGANs with projection discriminator (ICLR 2018).
License: MIT License
An unofficial PyTorch implementation of SNGAN (ICLR 2018) and cGANs with projection discriminator (ICLR 2018).
License: MIT License
hi
I see some cgan code use y in the input before first layer.
So why do you use in block 3 and block 4 in SNResNetConcatDiscriminator?
and also , i am wonder why do you use a lot of y in gen?
Thanks!!
There are some implementation wrong.
Point out that the place to put the condition is different.
Add condition to output after convolution such like,
Unofficial(this repository)
Official
thanks.
Hello
May i have one question?
utils.py > line 68~69
if distribution is None:
distribution == 'normal' -> I think it maybe " distribution = 'normal' "
if i'm wrong, please tell me what means ==
Thanks for your nice code :)
Due to the lack of GPUs, I ran this on 1080Ti for 12 hours (around 20K iterations).
The dataset is tiny-ImageNet. The original images are themselves a bit difficult to tell what is in each image.
same as the paper
Traceback (most recent call last):
File "train_64.py", line 402, in <module>
main()
File "train_64.py", line 325, in main
dis_fake = dis(fake, pseudo_y)
File "/home/crcrpar/.pyenv/versions/env1/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
result = self.forward(*input, **kwargs)
File "/home/crcrpar/.ghq/github.com/crcrpar/pytorch.sngan_projection/models/discriminators/snresnet64.py", line 91, in forward
h = self.block1(h)
File "/home/crcrpar/.pyenv/versions/env1/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
result = self.forward(*input, **kwargs)
File "/home/crcrpar/.ghq/github.com/crcrpar/pytorch.sngan_projection/models/discriminators/resblocks.py", line 72, in forward
return self.shortcut(x) + self.residual(x)
File "/home/crcrpar/.ghq/github.com/crcrpar/pytorch.sngan_projection/models/discriminators/resblocks.py", line 75, in shortcut
return self.c_sc(F.avg_pool2d(x, 2))
File "/home/crcrpar/.pyenv/versions/env1/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
result = self.forward(*input, **kwargs)
File "/home/crcrpar/.pyenv/versions/env1/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 301, in forward
self.padding, self.dilation, self.groups)
RuntimeError: Given groups=1, weight of size [64, 3, 1, 1], expected input[64, 256, 4, 4] to have 3 channels, but got 256 channels instead
Is there any training or testing results?
Hi, train 64x64 dataset with your code . But it failed , and I test something ,like D network and loss
Here is my result:
sn_projection Discriminator is good, and it work fine. but wrong use in code when computed dis_fake which I think input of D should be true_label not pesudo_y . you can try it , pesudo_y is not useful at all.
Hinge loss have some trouble and I was using LSGAN loss is work fine!
I found some differences in the networks from https://github.com/pfnet-research/sngan_projection . Please check below.
activation=activation, downsample=False)
h_ch = in_ch
self.c_sc = utils.spectral_norm(nn.Conv2d(in_ch, out_ch, 1, 1, 0))
return F.avg_pool2d(x, 2)
self.conv7 = nn.Conv2d(num_features, 3, 3, 1, 1)
Hi, I found a bug in fid score.
The normalization before inception model is written as:
pytorch.sngan_projection/models/inception.py
Lines 128 to 132 in 7afdca4
but it should be:
https://github.com/mseitzer/pytorch-fid/blob/4e366b2fc9fb933bec9f6f24c5e87c3bd9452eda/inception.py#L130-L131
or it should be fixed like:
if self.normalize_input:
mean = torch.tensor((0.485, 0.456, 0.406)).view(1, 3, 1, 1).cuda()
std = torch.tensor((0.229, 0.224, 0.225)).view(1, 3, 1, 1).cuda()
x = (x - mean) / std
Pointed out in #20
pytorch.sngan_projection/utils.py
Lines 68 to 69 in 095cceb
~Should be closed by #19 ~
Create a new one to fix it.
I type python train_64.py --no_tensorboard and run it...
I see the 'Initialized models...' print out and then I got a RuntimeError: CUDA error: initialization error. I am pretty sure my pyTorch version is '1.1.0'. Welcome to any solution. Thank you.
Following is the wrong feedback I got:
Traceback (most recent call last): File "train_64.py", line 402, in <module> main() File "train_64.py", line 341, in main real, y = sample_from_data(args, device, train_loader) File "train_64.py", line 199, in sample_from_data real, y = next(data_loader) File "/vm/data/rdata/shared/conda_envs/fastaiv1/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 582, in __next__ return self._process_next_batch(batch) File "/vm/data/rdata/shared/conda_envs/fastaiv1/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 608, in _process_next_batch raise batch.exc_type(batch.exc_msg) RuntimeError: Traceback (most recent call last): File "/vm/data/rdata/shared/conda_envs/fastaiv1/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 99, in _worker_loop samples = collate_fn([dataset[i] for i in batch_indices]) File "/vm/data/rdata/shared/conda_envs/fastaiv1/lib/python3.6/site-packages/torch/utils/data/_utils/collate.py", line 68, in default_collate return [default_collate(samples) for samples in transposed] File "/vm/data/rdata/shared/conda_envs/fastaiv1/lib/python3.6/site-packages/torch/utils/data/_utils/collate.py", line 68, in <listcomp> return [default_collate(samples) for samples in transposed] File "/vm/data/rdata/shared/conda_envs/fastaiv1/lib/python3.6/site-packages/torch/utils/data/_utils/collate.py", line 59, in default_collate return torch.tensor(batch)
pytorch.sngan_projection/losses.py
Lines 74 to 79 in da83bb3
s/gen/dis/g
gen_* loss ignores the dis_real
term
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.