Hi @JuanFMontesinos
Thanks for your help, I have done a print to check, as follow:
‘’’
class Dataset(data.Dataset):
def init(self, path_input_1, path_input_2):
    self.filenames_OI = []
    self.filenames_NI = []
    
    self.path_input_1 = path_input_1
    self.path_input_2 = path_input_2        
    print(len(self.path_input_1))
    
    filenames_OI = glob.glob(osp.join(self.path_input_1, '*.jpg'))
    filenames_NI = glob.glob(osp.join(self.path_input_2, '*.jpg'))
    print(len(filenames_OI)) 
    print(len(filenames_NI))
    
    for fn_OI, fn_NI in zip(filenames_OI, filenames_NI):
        self.filenames_OI.append(fn_OI)
        self.filenames_NI.append(fn_NI)

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

def __getitem__(self, index):
    #originalIMG = Image.open(self.filenames_OI[index])
    #noisyIMG = Image.open(self.filenames_NI[index])
    
    originalIMG = imageio.imread(self.filenames_OI[index])       
    noisyIMG = imageio.imread(self.filenames_NI[index])
    
    return torch.from_numpy(originalIMG), torch.from_numpy(noisyIMG)

‘’’
I get as result
53
6
6
I’ve been trying to figure out where this 53 is coming from, and I found it calculates the length of the string (’/DataSets/SimplifyData’’/imagesForTrain/OriginalImages/’) of the code:
 datadir  = '/DataSets/SimplifyData'
  traindir_OI = datadir + '/imagesForTrain/OriginalImages/'

Do you known why and how to solve it.