Giter Club home page Giter Club logo

pytorch-attention-guided-cyclegan's People

Contributors

alokwhitewolf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pytorch-attention-guided-cyclegan's Issues

some convergence questions

i wonder a better way to make this kind of attn-base generator convergence
could you please share some train tricks while you train this architecture ? : )

Implemenetation and paper differences

Very clean code, however I have found what I believe are differences between the paper and the code implementation in the model structure. Could you please share why these differences came into existence?

  1. According to Apendix A the last layer of generator should be c3s1-3-T, but rather c7s1-3-T is used in the code.
  2. The second up-scaling layer in the attention network is commented out (and having this in would mean the following conv should have stride 2?)
  3. The resblocks do not seem to relu the output and while the paper does not mention anything (just says use resblock), from what I know about them, the (out+x) should be passed through relu?
  4. Missing the s′new part of equation num 6?

Expected input channels mismatch

I get this error whenever I try to train the network using "train.py"

Traceback (most recent call last):
  File ".\train.py", line 237, in <module>
    all()
  File ".\train.py", line 141, in all
    attnMapA = toZeroThreshold(AttnA(realA))
  File "C:\Users\User1\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\nn\modules\module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "C:\Users\User1\Documents\Pytorch-Attention-Guided-CycleGAN\models.py", line 141, in forward
    return self.model(x)
  File "C:\Users\User1\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\nn\modules\module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "C:\Users\User1\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\nn\modules\container.py", line 92, in forward
    input = module(input)
  File "C:\Users\User1\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\nn\modules\module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "C:\Users\User1\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\nn\modules\conv.py", line 320, in forward
    self.padding, self.dilation, self.groups)
RuntimeError: Given groups=1, weight of size [32, 3, 7, 7], expected input[1, 4, 256, 256] to have 3 channels, but got 4 channels instead

It's also important to mention that i had to slightly modify the code for windows multiprocessing compatibility. I created a all() function that includes the whole code and gets run like this as stated in the Pytorch windows FAQ:

if __name__ == '__main__':
    all()

If I want to make attention in background.

Hi,
Thank you for this task. If I want to make attention in the background that I need to change rather than the object. For example, in domain A and B, we have horse images, when translating from domain A - B, I want to keep the same horse in domain B but the background will be changed as domain A. How I can do that? Thank you in advance.

bug in the train script

Hi,

I believe there is a bug in this line

DisLossB = fakeTargetLoss(disB(genB)) + fakeTargetLoss(disB(genB_)) + 2*realTargetLoss(disA(realB))

in the last term, there should be disB instead of disA, right?

I have a problem

Thank you for your implementation of Unsupervised Attention-guided Image-to-Image Translation. After learning your code, I found some difference between yours and the description of the original paper.
your code:
attnMapA = toZeroThreshold(AttnA(realA))
fgA = attnMapA * realA
bgA = (1 - attnMapA) * realA
genB = genA2B(fgA)
fakeB = (attnMapA * genB) + bgA
but in original paper, After feeding the input image to the generator, Apply the learned mask
to the generated image using an element-wise product ‘* ’, and then add the background using the
inverse of the mask applied to the input image.
attnMapA = toZeroThreshold(AttnA(realA))
fgA = attnMapA * realA
bgA = (1 - attnMapA) * realA
genB = genA2B(realA)
fakeB = (attnMapA * genB) + bgA
According to the original paper, genB = genA2B(realA) rather than genB = genA2B(fgA) , and then fakeB = (attnMapA * genB) + bgA
Could you tall me why do you implement the code in this way?
Finally, please forgive me for my bad English if it annoys you. =。=!

Test Image

Hi,
How can we get test images?
Thanks in advanced.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.