How can I modify the deeplabv3_resnet101 and fcn_resnet101 models available from torchvision segmentation models to accept input images with only 1 color channel?
I have seen some example of how I can modify resnet, but I am not sure how to do it for these
I faced the same issue, I have tried to fine-tune deeplabv3_resnet50/resnet101 and fcn_resnet50/resnet101 on grayscale images(one channel as input). I tried your solution mentioned above but it’s not working, this is the code that I m using
class FCN_resnet50(nn.Module):
def init(self, num_classes=2, pretrained=False):
super(FCN_resnet50, self).init()
model=fcn_resnet50(pretrained)
# model.eval()
# model=timm.create_model(‘fcn_resnet50’, pretrained, in_chans=1)
yes I m sure that using this model, my aim is to modify deeplabv3_resnet50/resnet101 and fcn_resnet50/resnet101 to segment medical imaging that is stored in 2d grayscale images
then I load the model through pytorch lightning module.
I meant to ask if you were executing my posted code snippet directly as I do not see the mentioned error. If you manipulate my code or are using it in another way, your change might cause the issue in which case a minimal and executable code snippet would be needed to help debugging it.