-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
finetune problem #36
Comments
here is the full information: |
The input channel number of the fc layer in pytorch version needs to be modified if the mask shape changes. Since the current input image size changes from 128x128 to 64x64 for the local discriminator, L260 in model/net.py should be updated to |
i updated net.py, and it works, thanks a lot. |
Hi, can you describe the steps for training with custom dataset in tensorflow. @nywang2019 |
@xyzdcgan hi,just follow what @shepnerd suggested in this post. see blow: |
Hi @nywang2019 can you please explain how does gan generate image..? What i know about GAN: there is a discriminator and generator, discriminator differ from fake and real image, and generator generate new images till discriminator cannot find difference between original and fake image. Even both use CNN algorithm in the model. My question how gan performs object removal..?? Lets say for example i have added a mask near eye region where it has wrinkle, and clicked the complete button. When image is generated how it is generated without wrinkle...? One of actual process of the GAN which i know is, ATTGAN, where to generate smiling image for non-smiling image, it gather smiling facial expression from dataset/model trained, then it apply those smiling expression to the image given as input. In case of GMCNN, how does model select mask area and then make it wrinkle free. Lets assume i have a face image with some pimple i applied mask and it removed pimples from image, how it was able to generated image without pimples. Can you please tell me what are internal process of GAN, how all this work. Thanks |
In short, GAN-based inpainting methods predict the user-marked regions based on image context. In your given example (remove pimples from face images), with the input image and the annotated region, the model infers the semantics (e.g. skin, eye, etc.) and low-level details (e.g. color, texture, etc.) of the marked region from the unknown regions (context), and composes the final result. The prediction of the semantics (whether it contains pimples or not in your example) is from the given image context and the learned priors from the training set. Thus, the final predicted region is highly likely to be different from the corresponding one of the ground truth, as the final model optimization goal is to encourage the prediction to be realistic just as the training data. For your mentioned ATTGAN, it has extra conditions as attribute vectors. With that, the GAN model can interactively control its prediction. Similar works or ideas can be referred to pixel2pixel and its following works. About the quick understanding of the GAN-based inpainting methods, you can treat the GAN loss as a learnable metric. It measures how real the prediction is (compared with the real data) from a high-level perspective (similar to human observers) instead of requiring pixel-wise similarities like L1 or L2 loss. |
I have a similar problem but instead of making the images and masks smaller, I made them 512x512 (images) and 256x256 (masks) and I get a similar error with different numbers reported. See #61 |
above @nywang2019 says he is using 512x512 training images but in the trace it says img sizes are 256x256. @shepnerd what would be needed to get the pretrain step to work with 512x512 training images? I get similar errors. |
I pretrained the model with my own data about 10 epochs. and the result does not converge. then i want to try finetune step.but failed. any one can help me? thanks. @shepnerd (my image size is 512X512, about 1000 pics in trainingset)
RuntimeError: size mismatch, m1: [4 x 4096], m2: [16384 x 1] at C:/w/1/s/tmp_conda_3.7_055457/conda/conda-bld/pytorch_1565416617654/work/aten/src\THC/generic/THCTens
orMathBlas.cu:273
The text was updated successfully, but these errors were encountered: