Hi @Nikronic
First thanks for your precious help.
Here are all the steps but I get another error. Do you know why?
I am using the Preview (Nightly) pytorch version because I am interesting by using
from torch.cuda import amp which exist only on the Nightly version.
my following folders are:
C:/DataSets/SimplifyData/imagesForTrain/OriginalImages/
and
C:/DataSets/SimplifyData/imagesForTrain/imagesForTrain/NoiseImages/
I have put in each folder (OriginalImages and NoiseImages) three .jpg images only for test:
Here is the complete code:
import os
import glob

import torch
import torch.cuda as cuda
import torch.nn as nn
from torch.nn import functional as F
from torch.utils import data

import matplotlib.pyplot as plt
import matplotlib.image as matpltimg

import torchvision
from torchvision import datasets
from torchvision import transforms

import numpy as np

from torch.cuda import amp

datadir  = '/DataSets/SimplifyData'

traindir_OI = datadir + '/imagesForTrain/OriginalImages/'
traindir_NI = datadir + '/imagesForTrain/NoiseImages/'

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

        filenames_OI = glob.glob(osp.join(path_input_1, '*.jpg'))
    	filenames_NI = glob.glob(osp.join(path_input_2, '*.jpg'))

        for fn_OI, fn_NI in 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):
    	x = Image.open(self.filenames_OI[index])
    	y = Image.open(self.filenames_NI[index])
    	return X, y

import os
import glob
import os.path as osp
from PIL import Image

path_labels = traindir_OI
path_inputs = traindir_NI

train_dataset = Dataset(path_input_1 = path_labels
    	               ,path_input_2 = path_inputs)

Now I get this error:

ValueError                                Traceback (most recent call last)
 in 
1 train_dataset = Dataset(path_input_1 = path_labels
----> 2                        ,path_input_2 = path_inputs)
 in init(self, path_input_1, path_input_2)
9         filenames_NI = glob.glob(osp.join(path_input_2, ‘*.jpg’))
10
—> 11         for fn_OI, fn_NI in filenames_OI, filenames_NI:
12             self.filenames_OI.append(fn_OI)
13             self.filenames_NI.append(fn_NI)
ValueError: not enough values to unpack (expected 2, got 0)