Hi,
I am creating a Class based on Dataset, in the function of __getitem__, I read each MRI and get all slices (100 slices from a MRI) into a list. Then the dataset was fitted into the DataLoader:
train_loader = DataLoader(data_train,
                              batch_size=options.batch_size,
                              shuffle=True,
                              num_workers=options.num_workers,
                              drop_last=True,
                              pin_memory=True)

The problem is that If I set shuffle=True, the batch data is shuffled based on subject-level, and for example, If the batch_size is 16, it will give me 16 different subjects, repeating 100 times…. Actually, I do not wanna this behavior because the slices were not reallly shuffled… Do you have any ideas to shuffle from the slice level???
I have tried to read only one slice in the function of  __getitem__, but when I train the mode, it is super slow…
Any idea would be appreciated…