-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
Hello.
I found that for some OS system (my environment is Ubuntu20.04), the class_to_idx property of dataset.ImageFolder is not aligned with the directories' name, so it leads to wrongly label samples.
For instance, the directory 100 (str) is labelled with 2 (int) class. The easiest way to resolve the above issue is, from the dataset.ImageFolder source code (https://pytorch.org/vision/stable/_modules/torchvision/datasets/folder.html#ImageFolder), modifying the line in find_classes function class_to_idx = {cls_name: i for i, cls_name in enumerate(classes)} with class_to_idx = {cls_name: int(cls_name) for cls_name in classes}.
roomo7time, shijxcs, ShunxinWang, yarinbar, oshapio and 3 moreyarinbar, dhkim0225 and EungyeupKim
Metadata
Metadata
Assignees
Labels
No labels