Views
No views yet
config.json file inside this repository and the original git repository from which the model originated.1git clone https://github.com/spolivin/cifar10-website.git
2cd cifar10-website/nn_dev1import torch
2
3from pytorch_models import resnet20
4
5# URL from which to load the weights
6URL = "https://huggingface.co/spolivin/cnn-cifar10/resolve/main/resnet20_weights.pth"
7
8# Building the ResNet-20 model
9resnet20_model = resnet20()
10
11# Loading the pretrained weights to the model
12resnet20_model.load_state_dict(
13 torch.hub.load_state_dict_from_url(
14 url=URL,
15 weights_only=True,
16 map_location=torch.device("cpu"),
17 )
18 )