Skip to content

Commit 11821d6

Browse files
committed
Add ResNet-101 pre-trained model
1 parent 7d150e8 commit 11821d6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

torchvision/models/resnet.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
'resnet18': 'https://s3.amazonaws.com/pytorch/models/resnet18-5c106cde.pth',
1212
'resnet34': 'https://s3.amazonaws.com/pytorch/models/resnet34-333f7ec4.pth',
1313
'resnet50': 'https://s3.amazonaws.com/pytorch/models/resnet50-19c8e357.pth',
14+
'resnet101': 'https://s3.amazonaws.com/pytorch/models/resnet101-5d3b4d8f.pth',
1415
}
1516

1617

@@ -171,8 +172,11 @@ def resnet50(pretrained=False):
171172
return model
172173

173174

174-
def resnet101():
175-
return ResNet(Bottleneck, [3, 4, 23, 3])
175+
def resnet101(pretrained=False):
176+
model = ResNet(Bottleneck, [3, 4, 23, 3])
177+
if pretrained:
178+
model.load_state_dict(model_zoo.load_url(model_urls['resnet101']))
179+
return model
176180

177181

178182
def resnet152():

0 commit comments

Comments
 (0)