Skip to content

Commit 08b1f59

Browse files
JirenJinsoumith
authored andcommitted
Create ImageFolder with the same (sorted) order on different machines (#193)
1 parent c1f88ef commit 08b1f59

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
@@ -24,7 +24,7 @@ def find_classes(dir):
2424
def make_dataset(dir, class_to_idx):
2525
images = []
2626
dir = os.path.expanduser(dir)
27-
for target in os.listdir(dir):
27+
for target in sorted(os.listdir(dir)):
2828
d = os.path.join(dir, target)
2929
if not os.path.isdir(d):
3030
continue

0 commit comments

Comments
 (0)