mrzhu-cool / pix2pix-pytorch Goto Github PK
View Code? Open in Web Editor NEWPyTorch implementation of "Image-to-Image Translation Using Conditional Adversarial Networks".
PyTorch implementation of "Image-to-Image Translation Using Conditional Adversarial Networks".
Hi, I notice that when testing the model, you don't set the model to eval mode. Is this a bug or some special reasons?
Hey just realized that the model forward/sequence is wrong.
E.g
Current code:
input is (nc) x 256 x 256
e1 = self.conv1(input)
# input is (ngf) x 128 x 128
e2 = self.batch_norm2(self.conv2(self.leaky_relu(e1)))
This should be
input is (nc) x 256 x 256
e1 = self.conv1(input)
# input is (ngf) x 128 x 128
e2 = self.conv2(self.leaky_relu(self.batch_norm2(e1)))
Hence both the discriminator and generator models are incorrect.
请问,你这个代码的结构和论文里边的结构完全一样么?
我看的不是很一样啊,论文里是编码器解码器的结构啊。
麻烦说下你这里的结构,如果方便的话,告诉我下我想改成论文里边那样子要改哪些~
Hello,
Thank you for your great work. However, I think you should add set_requires_grad(net_d, True/False) for discriminator during training. Is it true?
modified code:
# (1) Update D network
######################
set_requires_grad(net_d, True) # add it here
optimizer_d.zero_grad()
# train with fake
fake_ab = torch.cat((real_a, fake_b), 1)
pdb.set_trace()
pred_fake = net_d.forward(fake_ab.detach())
loss_d_fake = criterionGAN(pred_fake, False)
# train with real
real_ab = torch.cat((reala, real_b), 1)
pred_real = net_d.forward(real_ab)
loss_d_real = criterionGAN(pred_real, True)
# Combined D loss
loss_d = (loss_d_fake + loss_d_real) * 0.5
loss_d.backward()
optimizer_d.step()
set_requires_grad(net_d, False) # add it here
######################
I am looking forward to hearing from you. Thank you in advance!
@mrzhu-cool
For how many iterations should I train to regenerate the results for the Facades dataset ??
I can't understand the offset in dataset.py, Is it set for translation invariant? May you explain it for me, Thank you.
Hi,
I had hard time finding the PatchGAN part of code,Although you have commented before writing discriminator.Can you please point out where is it exactly there and how are you using it?
Thanks
I want to consider only L1 loss.Is it correct to comment out the generator loss as
#loss_g = loss_g_gan + loss_g_l1
and consider only,
loss_g = loss_g_l1
Do I need to change anything in discriminator part?
Thanks in advance
@mrzhu-cool
Why do I find that the output size will be smaller in the training results?
How can I modify the code to customize the output size or the same size as the input image...
I think you should have implemented unet for Generator structure not resnet
Hi!
Thank you for your good works.
I wanna apply Wasserstein loss to script
How can I do?
Thank you!
Hi,
I am getting a lot of artifacts when i am applying the code to train and test on face images.
@mrzhu-cool Any suggestions on how to avoid them ??
Thanks in advance
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.