Hello everyone, I have a Image .mat file with 60556 image samples. It has 2 key elements, “image_data” and “image_labels”. When I execute the following command, the result is as follows :
data = io.loadmat('/dataset/Train48d48.mat')
image_data = data['image_data']
image_labels = np.squeeze(data['image_labels'])
print(image_data.shape, image_labels.shape)

(60556, 48, 48, 3) (60556,)
i want build a dataloader. my code is  :
class MYDATASET(Dataset):
    def __init__(self, mat_paths):
        self.mat_paths ='/dataset/Train48d48.mat'
        
    def __getitem__(self, index):

        data = io.loadmat(self.mat_paths[index])
        x = data['image_data']
        y = np.squeeze(data['image_labels'])
        x = torch.from_numpy(x)
        y = torch.from_numpy(y)       
        return x, y
    
    def __len__(self):
        return len(self.mat_paths)

trainset = MYDATASET(mat_paths='/dataset')
trainloader = torch.utils.data.DataLoader(trainset, batch_size=128, shuffle=True, num_workers=2)

I was expecting after executing this command :
one_train_batch_imgs, one_train_batch_lbls = next(iter(trainloader))
print(one_train_batch_imgs.shape)

See the result below.
torch.Size([128, 3, 48, 48])
But I have an error like this : " FileNotFoundError: [Errno 2] No such file or directory: ‘d.mat’ "
Where is my mistake? Any suggestion,ideas, help would be Appreciated.