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])
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
1579 | 집청소. | WHRIA | 2007.06.25 | 5765 |
1578 | English Names [1] | WHRIA | 2007.08.14 | 5756 |
1577 | 윈도우 title bar 이름 얻기 | WHRIA | 2013.04.10 | 5738 |
1576 | 정원 관리 메뉴얼 | WHRIA | 2013.05.19 | 5720 |
1575 | 이보다 더 | 이영아 | 2000.06.10 | 5706 |
1574 | Add a background music | WHRIA | 2007.08.12 | 5659 |
1573 | 행복한 가정 | WHRIA | 2007.06.19 | 5620 |
1572 | 불가능을 가능하게 만드는 것 | WHRIA | 2007.08.21 | 5544 |
1571 | raptor | WHRIA | 2007.06.23 | 5481 |
1570 | 어제 레디어스 세미나에서 | WHRIA | 2013.02.21 | 5481 |
1569 | 피곤 | WHRIA | 2007.06.24 | 5399 |
1568 | 후배 | han | 2007.06.21 | 5389 |
1567 | Rainy day | WHRIA | 2007.08.08 | 5341 |
1566 | 홈피 새단장 경축 | 석원^^ | 2007.06.22 | 5301 |
1565 | 샌디애고 | WHRIA | 2007.07.06 | 5287 |
https://discuss.pytorch.org/t/how-to-extract-features-of-an-image-from-a-trained-model/119/3