torch内置模型
torch内置模型
使用
打印支持的模型:
print(dir(torchvision.models))
下载模型,加上pretrained=True
参数,会自动下载预训练好的模型:
resnet18 = models.resnet18(pretrained=True)
Downloading: "https://download.pytorch.org/models/resnet18-f37072fd.pth" to /home/guru_ge/.cache/torch/hub/checkpoints/resnet18-f37072fd.pth
打印网络层:
print(resnet18)
resnet
性能
网络 | flops(G) | params(M) |
---|---|---|
vgg16 |
15.484 |
138.358 |
resnet50 |
4.112 |
25.557 |
resnet18 |
1.819 |
11.690 |
mobilnet_v1 | 0.57 | 4.25 |
mobilenet_v2 |
0.314 |
3.505 |
mobilenet_v3_small |
0.059 |
2.543 |
mobilenet_v3_large |
0.225 |
5.483 |