Could you post a small code snippet or the line of code which throws this error?
If you would like to use a pretrained model, you should pass an image containing 3 channels.
Using grayscale images you could either repeat the channel dimension manually, use torchvision.transforms.Grayscale(num_output_channels=3) 43, or use a conv layer to “learn” the mapping from 1 to 3 channels at the beginning of the model.