You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to load images from folders using datasets.ImagesFolder(), i find the lables' order is not correct as shown in the folder. For example, I have different kinds of images in folders named from 1 to 100, if I use above function to read images and get corresponding labels, of course I will get the images and labels, but the labels for images will become 1, 10, 100, 11, 12, 13 which is not right for corresponding image. The right order should be 1, 2, 3, 4, 5 for corresponding images.
Hope I state the problem clearly and wish you can fix this bug. Thanks.
The text was updated successfully, but these errors were encountered:
The label names are sorted as strings.
This means that ['1', '10', '2'] is the correct sorting order according to Python.
You should instead use class_to_idx and classes to go back and forth between the two representations, see
When I try to load images from folders using datasets.ImagesFolder(), i find the lables' order is not correct as shown in the folder. For example, I have different kinds of images in folders named from 1 to 100, if I use above function to read images and get corresponding labels, of course I will get the images and labels, but the labels for images will become 1, 10, 100, 11, 12, 13 which is not right for corresponding image. The right order should be 1, 2, 3, 4, 5 for corresponding images.
Hope I state the problem clearly and wish you can fix this bug. Thanks.
The text was updated successfully, but these errors were encountered: