LETTER / env_setup /backbone_sanity_check.py
Sharath33's picture
Upload folder using huggingface_hub
02ac88d verified
import torch
import torchvision.models as models
backbone = models.resnet18(pretrained=True)
backbone.fc = torch.nn.Identity() # strip final FC → 512-d output
backbone.eval()
dummy = torch.randn(1, 3, 224, 224)
with torch.no_grad():
emb = backbone(dummy)
print(f"Embedding shape : {emb.shape}") # expect torch.Size([1, 512])