someone told me this, but I have not tried it yet

  
    
    
    Grayscale images for resenet and deeplabv3 vision
  
  
    You can always define a custom resnet and change the first layer to adapt for your input shape. For example, with resnet18: 
import torch 
import torchvision

resnet = torchvision.models.resnet18()

input = torch.randn((16,3,244,244))
output = resnet(input)
print(output.shape)

# this fails becasue resnet expects 3 channels

#input = torch.randn((16,1,244,244))
#output = resnet(input)
#print(output.shape)

import torch.nn as nn

class MyResNet(nn.Module):

    def __init__(self, in_channels=1):
…