Looks good with some minor tweaks.
I think you’ll get an error calling list(nn.Conv2d...).
Also, since we didn’t change the input size, we should take care to return the same spatial dimensions after the first conv layer. Using kernel_size=3 and padding=1 will result in the same size.
Here is the code:
x = torch.randn(1, 1, 224, 224)
model = models.vgg16(pretrained=False) # pretrained=False just for debug reasons
first_conv_layer = [nn.Conv2d(1, 3, kernel_size=3, stride=1, padding=1, dilation=1, groups=1, bias=True)]
first_conv_layer.extend(list(model.features))  
model.features= nn.Sequential(*first_conv_layer )  
output = model(x)