That’s strange, as your code seems to work for this dummy input image:
import torchvision.transforms.functional as TF

img = TF.to_pil_image(torch.randn(3, 224, 224))

transformations=transforms.Compose([
    transforms.ColorJitter(brightness=0.2,saturation=(0.8,1.62),contrast=(1,1.3),hue=(-0.02,0.02)),
    transforms.RandomAffine(degrees=180,translate=(0.05,0.05),scale=(0.9,1.1),shear=25),
    transforms.CenterCrop((64,64)),
    transforms.ToTensor(),
    transforms.Normalize([0.485,0.456,0.406],[0.229,0.224,0.225])
])

x = transformations(img)

Could you check the shape and type of img before passing it to self.transform?