Resnet50, change the output dimension

Hy guys, i would use transfer learning with resnet50. I use the KLDivLoss for the divergence of 2 distribution. Is there a possibility to change FC and have an output dimension of [9,224,224] (the dimension of a photo with 9 channels(my second distribution)?

I am new to pytorch so will only be able to provide high level help. If you wish you can add a GlobalPooling layer just after the last layer to obtain (9,1). Or you can define the new layer in your init and bypass the FC(x) in the forward() method of your derived nn.Module class.

There should be no problem doing this. Work on this problem from the last convolution layer and add the necessary 2d operations (conv2d, upsample2d, etc.) until you reach your desired output shape.