Thank you for your message :
class KittiLoader(data.Dataset):
    def __init__(self, root, split="training",
                 img_size=512, transforms=None, target_transform=None):
        self.root = root
        self.split = split # that how i initialize self.split 
        self.target_transform = target_transform
        self.n_classes = 2
        self.img_size = img_size if isinstance(img_size, tuple) else (img_size, img_size)

        self.files = collections.defaultdict(list)
        self.labels = collections.defaultdict(list)
        self.transforms = transforms
        self.name = 'kitti'

        for split in ["training", "testing"]:
            file_list = glob(os.path.join(root, split, 'image_2', '*.png'))
            self.files[split] = file_list

            if not split=='testing':
                label_list=glob(os.path.join(root, split, '*.txt'))
                self.labels[split] = label_list




    def __len__(self): # that is my __len__ method
        return len(self.files[self.split])