class Datasetload(Dataset):
    
    def __init__(self, file_path, transform=None):
        self.data = pd.read_csv(file_path)
        self.transform = transform
        
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, index):
        image = self.data.iloc[index, 1:].values.astype(np.uint8).reshape((1, 28, 28))[:,:,:,None]
        label = self.data.iloc[index, 0]
        
        if self.transform is not None:
            image = self.transform(image)
        print(type(image))
            
        return image , label

train_dataset=Datasetload(train_dir,transform)

train_loader = torch.utils.data.DataLoader(train_dataset, batch_size=8, shuffle=True)

images,labels=next(iter(train_loader))

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-105-22d806a2b5c6> in <module>()
----> 1 images,labels=next(iter(train_loader))

2 frames
<ipython-input-99-3070471367a5> in __getitem__(self, index)
     13 
     14         if self.transform is not None:
---> 15             image = self.transform(image)
     16         print(type(image))
     17 

TypeError: 'tuple' object is not callabl