Thank you for your hint.
I made following script:
rootpath = '<mypath>'
paths = []
for subdir, dirs, files in os.walk(rootpath):
    for file in files:
        #print os.path.join(subdir, file)
        filepath = subdir + os.sep + file
        paths.append(filepath)


class ImageDataset(Dataset):
    def __int__(self):
        self.imagelist = paths

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

    def __getitem__(self, index):
        self.imagepath = self.imagelist[index]
        self.image = Image.open(self.imagepath)

        transform = transforms.Compose([
                    transforms.ToPILImage(),
                    transforms.Resize(256),
                    transforms.CenterCrop(224),
                    transforms.ToTensor(),
                    transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
                    ])

        i = transform(self.image)
        return i


imagedataset = ImageDataset()

imagedl = torch.utils.data.DataLoader(imagedataset, batch_size=300, drop_last=True)

for index, img in enumerate(imagedl):
    print(index, img)

And i get following error if I want to iterate over the dataloader:
AttributeError: 'ImageDataset' object has no attribute 'imagelist'
Why? I declare self.imagelist as a list of all my imagepaths