Created
December 4, 2017 04:21
-
-
Save yvan/9aca6ec23340bf6b52ca7a56c3acb006 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create new noise to pass to the generator | |
noise = to_variable(torch.randn(batch_size, noise_dim, 1, 1)) | |
# load the generator from epoch 90 of training | |
load_model = os.path.join(pokemon_models, 'generator_dec317_ep_%d' % 90) | |
generator_final = Generator() | |
generator_final.load_state_dict(torch.load(load_model)) | |
generator_final.cuda() | |
# generate new monsters | |
fixed_imgs = generator_final(noise) | |
result = denorm_monsters(fixed_imgs.cpu().data) | |
result = make_grid(result) | |
result = transforms.Compose([transforms.ToPILImage()])(result) | |
# plot those monsters | |
plt.figure(figsize=(20,15)) | |
plt.imshow(result) | |
plt.axis('off') | |
_ = plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment