I think the easier way would be to set the last fc layer in your pretrained resnet to an nn.Identity layer and pass the output to the new label_model layer.
Would this code work for you?
class CNN(nn.Module):
    def __init__(self, num_classes):
        super(CNN, self).__init__()
        self.model_resnet = models.resnet18(pretrained=True)
        fc_inputs = self.model_resnet.fc.in_features
        self.model_resnet.fc = nn.Identity()
        self.label_model = nn.Linear(fc_inputs, num_classes)

    def forward(self, images):
        with torch.no_grad():
            features = self.model_resnet(images)
        labels = self.label_model(features)
        return labels
    

model = CNN(2)
x = torch.randn(2, 3, 224, 224)
output = model(x)

I’m not sure where the fc_inputs * 32 came from.
Also, I’ve formatted your code so that I could copy it foe debugging.
If you would like to post some code, you can wrap it in three backticks ```