Thank you for your prompt reply
I rebuild vgg16 ,it can work(pretrained = True or False) , I rebulit resnet18, it can’t work, but I don know why?
class VGG16(nn.Module):
    def __init__(self, out_dim, *args, **kwargs):
        super(VGG16, self).__init__(*args, **kwargs)
        vgg16 = torchvision.models.vgg16(pretrained=True)
        self._up_kwargs = {'mode': 'bilinear', 'align_corners': True}
        self.features = vgg16.features
        self.conv1x1 = nn.Conv2d(512, out_dim, 1,1,0)
        self.deconv = nn.ConvTranspose2d(512, out_dim, kernel_size=32, stride=32, padding=0, output_padding=0)
    def forward(self, x):
        imsize = x.size()[2:]
        x =self.features(x)
        x = self.conv1x1(x)
        x = F.upsample(x, imsize, **self._up_kwargs)
        x = [x]
        return tuple(x)

class ResNet18(nn.Module):
    def __init__(self, out_dim, *args, **kwargs):
        super(ResNet18, self).__init__(*args, **kwargs)
        resenet18 = torchvision.models.resnet18(pretrained=True)
        self.conv1 = resenet18.conv1 
        self.bn1 = resenet18.bn1
        self.relu = resenet18.relu
        self.maxpool = resenet18.maxpool
        self.c1 = resenet18.layer1
        self.c2 = resenet18.layer2
        self.c3 = resenet18.layer3
        self.c4 = resenet18.layer4
        self.deconv = nn.ConvTranspose2d(512, out_dim, kernel_size=32, stride=32, padding=0, output_padding=0)

    def forward(self, x):
        x =self.conv1(x)
        x = self.bn1(x)
        x = self.relu(x)
        x = self.maxpool(x)
        x = self.c1(x)
        x = self.c2(x)
        x = self.c3(x)
        x = self.c4(x)        
        x = self.deconv(x)
        x = [x]
        return tuple(x)

I  find resulit of segmentation,The jagged phenomenon is obvious.  I try to use Multiple models , but get same result. A small square appears in the lane probability map.

image.png1267×728 23.9 KB

this image show result of Vgg16