Here is a working solution for ResNet:
  
    
    
    How to modify the input channels of a Resnet model 
  
  
    Here is a generic function to increase the channels to 4 or more channels. 
One key point is that the additional channel weights can be initialized with one original channel rather than being randomized. 
new_in_channels = 4
model = models.resnet18(pretrained=True)

layer = model.conv1
        
# Creating new Conv2d layer
new_layer = nn.Conv2d(in_channels=new_in_channels, 
                  out_channels=layer.out_channels, 
                  kernel_size=layer.kernel_size, 
                  stri…