Giuseppe:

I tried in resnet 50 (on encoder) to put self.model.conv1.in_channels = 9 but i still error.


Changing the in_channels attribute after creating the module won’t reinitialize the weights and would need to assign a new nn.Conv2d object to self.model.conv1, which accepts 9 input channels.