All credits go to https://huggingface.co/madrylab/robust-imagenet-models
I simply extracted the model weights from their checkpoints, so they are loadable in PyTorch.
Verify the weights
You can verify that the files contain model weights that are identical to the checkpoints. The verification process will be slow, because you need to download 33GB of the original checkpoints.
python -m venv .venv
source .venv/bin/activate
pip install huggingface-hub torch torchvision tqdm
python verify.py
Usage
import torch
from torchvision.models import resnet18
model = resnet18()
model.load_state_dict(torch.load("resnet18_l2_eps1.pth", weights_only=True))
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support