Hi Ptrblck,
I wrote my custom data loader based on your guidance. The code is correct and work. The problem is that by changing the BatchSize, It does not work properly, every time it gives me data in 64 Batchsize regardless of the Batchsize number. Would you please help me with that?
workers=2
Batchsize=128

datarootNorm='//homeHealthytorchpatch_v1/'

datasetNorm=DatasetLoad(datarootNorm,transforms=transform,debug=False,ii=1)

dataloaderNormal = torch.utils.data.DataLoader(datasetNorm, batch_size=Batchsize,shuffle=True, num_workers=workers)


class DatasetLoad():

    def __init__(self, root_dirTrain,transforms, debug,ii):
        self.patches, self.labels = None, None
        self.ii=ii
        patch_path = os.path.join(root_dirTrain,'Healthyzone'+str(self.ii)+".csv")
        ## 15000x1x64x64
        self.patches=torch.load(patch_path) 
        # self.patches = scipy.io.loadmat(patch_path)['ImagesNormal']
        # patch_path = os.path.join(root_dirTrain,"NegTraining11_v1"+".mat")
        # self.patches = scipy.io.loadmat(patch_path)['NegTraining11_v1']
        self.transforms = transforms
        self.debug = debug

    def __getitem__(self, index):

        patchF = self.patches[index,:, : ,:]

        if self.transforms is not None:

            patchF = self.transforms(patchF)

        return patchF


    def __len__(self):
        return self.patches.shape[-1]