File size: 188 Bytes
4f8a34f | 1 2 3 4 5 6 7 8 | import torch
device = "cuda" if torch.cuda.is_available() else "cpu"
def get_model():
from torchvision.models import resnet18
return resnet18(weights='IMAGENET1K_V1').to(device)
|
4f8a34f | 1 2 3 4 5 6 7 8 | import torch
device = "cuda" if torch.cuda.is_available() else "cpu"
def get_model():
from torchvision.models import resnet18
return resnet18(weights='IMAGENET1K_V1').to(device)
|