Created
August 9, 2019 23:31
-
-
Save ksivaman/b3bc45188d0a39e01335167bf98eb1ad to your computer and use it in GitHub Desktop.
initialize pretrained model for neural style transfer
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
vgg = models.vgg19(pretrained=True).features | |
# freeze VGG params to avoid chanhe | |
for param in vgg.parameters(): | |
param.requires_grad_(False) | |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu") | |
vgg.to(device) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment