model split
2020.07.30 08:15
https://forums.fast.ai/t/pytorch-best-way-to-get-at-intermediate-layers-in-vgg-and-resnet/5707/2
class ResNet50Bottom(nn.Module): def __init__(self, original_model): super(ResNet50Bottom, self).__init__() self.features = nn.Sequential(*list(original_model.children())[:-2]) def forward(self, x): x = self.features(x) return x res50_model = models.resnet50(pretrained=True) res50_conv2 = ResNet50Bottom(res50_model) outputs = res50_conv2(inputs) outputs.data.shape # => torch.Size([4, 2048, 7, 7])
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
1789 | Malayalam - മലയാളം | WHRIA | 2024.05.24 | 6 |
1788 | Mongolian - монгол | WHRIA | 2024.05.24 | 6 |
1787 | Portuguese - português | WHRIA | 2024.05.24 | 6 |
1786 | Samoan - Samoan | WHRIA | 2024.05.24 | 6 |
1785 | Esperanto - esperanto | WHRIA | 2024.05.24 | 7 |
1784 | Icelandic - íslenska | WHRIA | 2024.05.24 | 7 |
1783 | Irish - Gaeilge | WHRIA | 2024.05.24 | 7 |
1782 | Lithuanian - lietuvių | WHRIA | 2024.05.24 | 7 |
1781 | Polish - polski | WHRIA | 2024.05.24 | 7 |
1780 | Swahili - Kiswahili | WHRIA | 2024.05.24 | 7 |
1779 | Turkish - Türkçe | WHRIA | 2024.05.24 | 7 |
1778 | Urdu - اردو | WHRIA | 2024.05.24 | 7 |
1777 | Western Frisian - Frysk | WHRIA | 2024.05.24 | 7 |
1776 | Haitian Creole - Haitian | WHRIA | 2024.05.24 | 8 |
1775 | Hausa - Hausa | WHRIA | 2024.05.24 | 8 |
https://discuss.pytorch.org/t/how-to-extract-features-of-an-image-from-a-trained-model/119/3