How to modify the input channels of a Resnet model


(Sjt Uzhanglj) #1

I’m new to Pytorch.
I want to input a 4-channel tensor into a Resnet model, but the channel numbers of default input is 4.
Any one teach me how to realize this modification, please?


#2

Hi, if you’re still interested:

https://discuss.pytorch.org/t/transfer-learning-how-to-modify-the-first-conv2d-layer-of-alexnet-to-accomodate-for-9-channel-input/4063

I’m currently trying it now to make it use for medical images that may have 18 slices thus 18 channels of grayscale images.


#3

I’m facing the same problem. Does it work?


(Pierre) #4

I want a 2-channel resnet, is it possible with resnet18() for instance? and How?