Skip to content

Instantly share code, notes, and snippets.

@cosmic-cortex
Created April 29, 2020 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cosmic-cortex/096fea657dc8a184fb7dd63a8205723d to your computer and use it in GitHub Desktop.
Save cosmic-cortex/096fea657dc8a184fb7dd63a8205723d to your computer and use it in GitHub Desktop.
import torch
from torchvision.models import resnet34
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
model = resnet34(pretrained=True)
model = model.to(device)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment