Probably, you may need to refer related to the datasets.


ResNet-xx models are trained for ImageNet data, which expects images of size 224x224 and predicts output for 1000 classes.

CIFAR10 data has 32x32 images and 10 classes.

The first error in your post is due to the size mismatch.
In the second behavior, it is predicting class probabilities (to be specific, logits) for 1000 classes of ImageNet.
If you want to predict for CIFAR10, use some pretrained models for CIFAR10.
This repo might help:

  
      
      GitHub
  
  
    

akamaster/pytorch_resnet_cifar10 180

Proper implementation of ResNet-s for CIFAR10/100 in pytorch that matches description of the original paper. - akamaster/pytorch_resnet_cifar10