赞
踩
- model_urls = {
- 'resnet18': 'https://download.pytorch.org/models/resnet18-f37072fd.pth',
- 'resnet34': 'https://download.pytorch.org/models/resnet34-b627a593.pth',
- 'resnet50': 'https://download.pytorch.org/models/resnet50-0676ba61.pth',
- 'resnet101': 'https://download.pytorch.org/models/resnet101-63fe2227.pth',
- 'resnet152': 'https://download.pytorch.org/models/resnet152-394f9c45.pth',
- 'resnext50_32x4d': 'https://download.pytorch.org/models/resnext50_32x4d-7cdf4587.pth',
- 'resnext101_32x8d': 'https://download.pytorch.org/models/resnext101_32x8d-8ba56ff5.pth',
- 'wide_resnet50_2': 'https://download.pytorch.org/models/wide_resnet50_2-95faca4d.pth',
- 'wide_resnet101_2': 'https://download.pytorch.org/models/wide_resnet101_2-32ee1156.pth',
- }
两种载入的方法:
- # methold1:
- # model = torchvision.models.resnet152(pretrained=True)
-
- # methold2:
- model=torchvision.models.resnet152()
- model.load_state_dict(torch.load('./resnet152-394f9c45.pth'))
[1] 参考pytorch, torchvision.modules.resnet
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。