Skip to content

Commit 40fdf71

Browse files
GabrielBianconisoumith
authored andcommitted
Sort images while creating dataset in ImageFolder (#218)
1 parent 85bb16a commit 40fdf71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchvision/datasets/folder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def make_dataset(dir, class_to_idx):
3030
continue
3131

3232
for root, _, fnames in sorted(os.walk(d)):
33-
for fname in fnames:
33+
for fname in sorted(fnames):
3434
if is_image_file(fname):
3535
path = os.path.join(root, fname)
3636
item = (path, class_to_idx[target])

0 commit comments

Comments
 (0)