Skip to content
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

PyTorch implementation generates same image samples #34

Closed
kwhuang88228 opened this issue Feb 21, 2022 · 6 comments
Closed

PyTorch implementation generates same image samples #34

kwhuang88228 opened this issue Feb 21, 2022 · 6 comments

Comments

@kwhuang88228
Copy link

Hi, I'm getting the same output image samples (see below) when I train the PyTorch implementation on FFHQ from scratch. The only changes I made (due to some memory issues mentioned in #33) were adding --batch-gpu 1 and removing saving attention map functionality (commenting out pytorch_version/training/visualize.py lines 167-206).

python run_network.py --train --gpus 0 --batch-gpu 1 --ganformer-default --expname ffhq-scratch --dataset ffhq
000120
000240

@dorarad
Copy link
Owner

dorarad commented Feb 21, 2022

Hi, Thank you for sharing that! Based on the info that seems to be a bug, I've started now several experiments that seek to identify the source of the problem and hope to get back to you in couple days with more info!

@dorarad
Copy link
Owner

dorarad commented Feb 21, 2022

  • one more thing, what number does it show you as the training set size? It should say:
Loading training set...
Num images: [NUM]

I want to make sure you have the training data correctly. As a further indication, you should have a file reals.png, would you be able to upload it? Thanks!

@kwhuang88228
Copy link
Author

kwhuang88228 commented Feb 22, 2022

Thank you for looking into this! I have Num images: 20004. And this is my reals.png.
reals

@dorarad
Copy link
Owner

dorarad commented Feb 22, 2022

Thanks! I had a small bug in the PyTorch initialization of the mapping network's weight parameters (see e987448), that should both resolve the same-images issue, and more importantly, I expect it to speed up the model's learning substantially.

Please consider retraining a new model from scratch (so that the weights get initialized correctly) to achieve the improved learning. I will run too further experiments now to verify it indeed gets resolved and get back to you!

python run_network.py --train --gpus 0 --batch-gpu 1 --ganformer-default --expname ffhq-scratch-new --dataset ffhq

@dorarad
Copy link
Owner

dorarad commented Feb 22, 2022

Alright I tested the model and things look good!

@kwhuang88228
Copy link
Author

kwhuang88228 commented Feb 22, 2022

Can also confirm PyTorch model is no longer generating the same images. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants