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])
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
259 | 802.11ac 규격 | WHRIA | 2013.02.15 | 5122 |
258 | Shizuoka | WHRIA | 2007.06.27 | 5211 |
257 | 거품이 끼었다. | WHRIA | 2007.07.31 | 5258 |
256 | 와우~ | 하은이 | 2007.06.23 | 5259 |
255 | 샌디애고 | WHRIA | 2007.07.06 | 5291 |
254 | 홈피 새단장 경축 | 석원^^ | 2007.06.22 | 5310 |
253 | Rainy day | WHRIA | 2007.08.08 | 5348 |
252 | 후배 | han | 2007.06.21 | 5395 |
251 | 피곤 | WHRIA | 2007.06.24 | 5401 |
250 | raptor | WHRIA | 2007.06.23 | 5482 |
249 | 어제 레디어스 세미나에서 | WHRIA | 2013.02.21 | 5489 |
248 | 불가능을 가능하게 만드는 것 | WHRIA | 2007.08.21 | 5546 |
247 | 행복한 가정 | WHRIA | 2007.06.19 | 5628 |
246 | Add a background music | WHRIA | 2007.08.12 | 5661 |
245 | 이보다 더 | 이영아 | 2000.06.10 | 5712 |
https://discuss.pytorch.org/t/how-to-extract-features-of-an-image-from-a-trained-model/119/3