I was able to apply transformation on a downloaded images(custom dataset) , But even though i applied the mean and standard deviation i am still getting test accuracy 0. While training the loss is decreasing, and after about 20 epoch it is 0. So i dont understand why i am getting 0% accuracy for the test set. Is my transformation code is correct?    i had to define the downloaded data twice (‘data’) becuase if i dont define it in the __get__item it will throw an error. If i don’t define it in init i will not be able to add the channel dimension by unsqueezing, since the dataset comes as 4006464 format. Pls have a look at the code and tell me if u find any bug.
transformations = transforms.Compose([transforms.ToTensor(),transforms.Normalize((0.5444,),(0.1581,))])
class dataset_transformed():

def __init__(self,transform=None):
    data = np.load("./Downloads/11928_16420_bundle_archive/olivetti_faces.npy")
    target = np.load("./Downloads/11928_16420_bundle_archive/olivetti_faces_target.npy")
    self.x = torch.from_numpy(data)
   
   
    self.x = self.x.unsqueeze(1)
   
    self.y = torch.from_numpy(target)
    self.y = self.y.type(torch.LongTensor)
   
    self.transform = transform
   
def __getitem__(self,index):
    data = np.load("./Downloads/11928_16420_bundle_archive/olivetti_faces.npy")
   
   
    if self.transform is not None:
        
        data = self.transform(data)
        
       
        
   
    return self.x[index],self.y[index]

def __len__(self):
    
    return self.n_samples

 dataset = dataset_transformed(transformations) #calling the class