Skip to content

Commit

Permalink
Fix torchvision pretrained deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jojje committed May 3, 2024
1 parent f61dde4 commit 306e762
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions simclr/modules/resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

def get_resnet(name, pretrained=False):
resnets = {
"resnet18": torchvision.models.resnet18(pretrained=pretrained),
"resnet50": torchvision.models.resnet50(pretrained=pretrained),
"resnet18": torchvision.models.resnet18(weights=torchvision.models.ResNet18_Weights.DEFAULT),
"resnet50": torchvision.models.resnet50(weights=torchvision.models.ResNet50_Weights.DEFAULT),
}
if name not in resnets.keys():
raise KeyError(f"{name} is not a valid ResNet version")
Expand Down

0 comments on commit 306e762

Please sign in to comment.