How to feed my picture to the resnet model?

I used the resnet50 model in torchvision.models to train a classification model.Now I want load a new picture to predict.It works when I use the torch.utils.data.DataLoader to feed the picture to my model,but when I load the picture and change it to a torch.Tensor,it dosn’t work.They are all <class ‘torch.Tensor’>,and have same size.The error is size mismatch, m1: [1 x 8192], m2: [2048 x 100].What should I do?Please help me.

CODE:
inputs, classes = next(test_dataloader)
print(type(inputs))
print(inputs.size())

sample = test_datasets.getitem(0)
img = sample[0].float()
img.resize_(1,3,244,244)
print(type(img))
print(img.size())

model_test = ‘resnet50_1’
model_ft = torch.load(model_dir+model_test)
model_ft.eval()
img = img.to(device)
outputs = model_ft(img)
_, preds = torch.max(outputs, 1)

Your images should be [batch_size, 3, 224, 224].
It looks like a small typo to resize img to [1, 3, 244, 244].

yes i know,but my batch size is 1,they are all [1,3,244,244]

The error comes from the width and height.
They should be 224 instead of 244.
Sorry for making it not clear in the first answer.