Skip to content

model split

2020.07.30 08:15

WHRIA 조회 수:142

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])

Powered by Xpress Engine / Designed by Sketchbook

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소