I have the same problem. And I think that you can try the following:
data_dir = "mine"
img_data = torchvision.datasets.ImageFolder(os.path.join(data_dir))

You can look at any of the examples provided in the official documentation to see how to use it.
My understanding is to read the upper layer of the folder where the file is located.
Just like when reading many classes, instead of reading each class, it is directly read into the folder called “train”, which is the upper layer of the folder you want.