ResNet 50, different input size

Hi guys, I would pass to a resNet50 pretrained the batch of dimension (16x9x224x224).
16 is the number of batch, 9 is the channels of my image and 224 x 224 is the width and height respectively.
How can I change the input dimension?
So that only change of the net is the channels of images in input.
Sorry for my bad English :slight_smile:

1 Like

With the adaptive average pool layer, resnet from torchvision can work with custom input dimensions now. Can you try posting the error if you’re encountering it ?

from torchvision.models import resnet50

net = resnet50()
net.conv1.in_channels = 9
1 Like