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

how to sample images with a trained model #1

Open
gefeiwang opened this issue Jul 25, 2019 · 2 comments
Open

how to sample images with a trained model #1

gefeiwang opened this issue Jul 25, 2019 · 2 comments

Comments

@gefeiwang
Copy link

Thank you for providing this neat code!!!
I have trained your model on CIFAR-10, but I don't know how to get samples. Is there any function or script to generate samples with a trained model?

@richardwth
Copy link
Owner

Sorry for the late reply. If you check line 499 of DeepLearning/my_sngan.py, you may notice the method eval_sampling randomly generates image samples and save the generated images to a sprite image file. You may also add one line to return the x_gen_value, which contains the generated images in numpy array format.

Note that this method is called in line 88-90 of my_test_cifar.py, so perhaps the simplest way is to comment out line 83-87 and line 91-94 in my_test_cifar.py, decrease the indentation of line 88-90, and run the file. In this case, the file would avoid the training phase and directly do the sampling. Please also note that my code by default uses the latest saved model in the ckpt_folder defined at line 522 of DeepLearning/my_sngan.py (which should be FLAGS.DEFAULT_OUT + filename + subfolder).

Please feel free for any further question. Thanks for your interest.

@gefeiwang
Copy link
Author

Sorry for the late reply. If you check line 499 of DeepLearning/my_sngan.py, you may notice the method eval_sampling randomly generates image samples and save the generated images to a sprite image file. You may also add one line to return the x_gen_value, which contains the generated images in numpy array format.

Note that this method is called in line 88-90 of my_test_cifar.py, so perhaps the simplest way is to comment out line 83-87 and line 91-94 in my_test_cifar.py, decrease the indentation of line 88-90, and run the file. In this case, the file would avoid the training phase and directly do the sampling. Please also note that my code by default uses the latest saved model in the ckpt_folder defined at line 522 of DeepLearning/my_sngan.py (which should be FLAGS.DEFAULT_OUT + filename + subfolder).

Please feel free for any further question. Thanks for your interest.

It works. Thanks a lot!

@gefeiwang gefeiwang reopened this Jul 29, 2019
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