Created
July 12, 2020 17:40
-
-
Save wcneill/a7674385e592b3ad4a3ff8e4c1aa8af3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Define pre-trained model | |
vgg = models.vgg19(pretrained=True).features | |
# Freeze all model weights | |
for param in vgg.parameters(): | |
param.requires_grad_(False) | |
# Move model to GPU, if available. | |
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