Hi,
I created custom dataset for classification of 8 channel images.
I get an IndexError: list index out of range when I lanch the trainning.
Do you see errors on my dataset?
LABEL_FILENAME="label.tif"

class Dataset(torch.utils.data.Dataset):
    def __init__(self, data_dir,):
        self.data_dir = data_dir#os.path.join(root_dir)
        self.samples = list()
        self.classes = [ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]

        files = os.listdir(self.data_dir)
        for f in files:
            self.samples.append(f)

    def __len__(self):
        return len(self.samples)

    def __getitem__(self, idx):

        path = os.path.join(self.data_dir, self.samples[idx])
        print("p",self.samples[idx])
        label, profile = read(os.path.join(path,LABEL_FILENAME))
        label=label[0]

        label = torch.from_numpy(label)

        x = read(os.path.join(path, "MHCHD_22E01N.tif"))[0]
        x= np.array(x)
        x =torch.from_numpy(x)


        return x.float(), label.long()