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])
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
1819 | Afrikaans - Afrikaans | WHRIA | 2024.05.24 | 0 |
1818 | Albanian - shqip | WHRIA | 2024.05.24 | 0 |
1817 | Amharic - አማርኛ | WHRIA | 2024.05.24 | 0 |
1816 | Arabic - العربية | WHRIA | 2024.05.24 | 0 |
1815 | Armenian - հայերեն | WHRIA | 2024.05.24 | 0 |
1814 | Azerbaijani - azərbaycan | WHRIA | 2024.05.24 | 0 |
1813 | Bangla - বাংলা | WHRIA | 2024.05.24 | 0 |
1812 | Basque - euskara | WHRIA | 2024.05.24 | 0 |
1811 | Belarusian - беларуская | WHRIA | 2024.05.24 | 0 |
1810 | Bosnian - bosanski | WHRIA | 2024.05.24 | 0 |
1809 | Burmese - မြန်မာ | WHRIA | 2024.05.24 | 0 |
1808 | Catalan - català | WHRIA | 2024.05.24 | 0 |
1807 | Chinese (China) - 中文(中国) | WHRIA | 2024.05.24 | 0 |
1806 | Chinese (Taiwan) - Chinese (Taiwan) | WHRIA | 2024.05.24 | 0 |
1805 | Corsican - Corsican | WHRIA | 2024.05.24 | 0 |
https://discuss.pytorch.org/t/how-to-extract-features-of-an-image-from-a-trained-model/119/3