How to concat resnet output and original size of input image?
I have image dataset with 17 classes. There is a significant differ in sizes of some classes eg. images in one class are on average 250x200 and in the other class 25x25.
My idea was to concat output of pretrained resnet18 and original image size, because I think it's a valuable information for classification.
To be more specific - I would like to use resnet18 but to the last layer which is
(fc): Linear(in_features=512, out_features=17, bias=True)
I would like to add also Image.Shape which might be important for better classification.
Is this a reasonable solution for this kind of problem and is there a way to do it in PyTorch?

I guess you want to use the embedding that are produced by the Adaptive Pooling layer to have a fixed output size. First you need to get rid of the last linear layer (see this post):
model = models.resnet152(pretrained=True)
newmodel = torch.nn.Sequential(*(list(model.children())[:-1]))

Then you can get the embeddings and use pytorch.cat for concatenation:
out = model(X)
emb = torch.cat([out, X.shape])

