@ptrblck my updated code for making prediction on test set, i still get the same error as before,please check the code :
class decode_images(Dataset):

    def __init__(self, csv_file):

        self.data = csv_file

    def __len__(self):
        return len(self.data)

    def __getitem__(self, idx):
        img_name =  self.data.loc[idx][0]
        image = Image.open(img_name)
        image = image.resize((512, 512), resample=Image.BILINEAR)
        #image = self.transform(image)
        return {'image': transforms.ToTensor()(image)}

test_loader = torch.utils.data.DataLoader(testdataset, batch_size=1, shuffle=False) # test_set contains only images directory

for param in model.parameters():
    param.requires_grad = False


tk0 = tqdm(test_loader)
for i, x_batch in enumerate(tk0):
    print(i)
    print(x_batch)
    x_batch = x_batch["image"]
    pred = model(x_batch.to(device))
    sub.Label[i] = pred