5_layers = nn.Sequential(Bottleneck(1024, 512, downsample=nn.Sequential(nn.Conv2d(1024, 2048, 1, bias=False), nn.BatchNorm2d(2048))),Bottleneck(2048, 512),Bottleneck(2048, 512))
如果设计自己的网络,只需要把resnet从torchvision.models.resnet50 里边导出来resnet50 ,然后,根据自己的需要 ,重新搭建即可,
self.backbone = nn.Sequential(resnet.conv1,resnet.bn1,resnet.relu,resnet.maxpool,resnet.layer1,resnet.layer2,resnet.layer3[0],)