Commit 08b1f59f authored by Jiren Jin's avatar Jiren Jin Committed by Soumith Chintala
Browse files

Create `ImageFolder` with the same (sorted) order on different machines (#193)

parent c1f88ef1
...@@ -24,7 +24,7 @@ def find_classes(dir): ...@@ -24,7 +24,7 @@ def find_classes(dir):
def make_dataset(dir, class_to_idx): def make_dataset(dir, class_to_idx):
images = [] images = []
dir = os.path.expanduser(dir) dir = os.path.expanduser(dir)
for target in os.listdir(dir): for target in sorted(os.listdir(dir)):
d = os.path.join(dir, target) d = os.path.join(dir, target)
if not os.path.isdir(d): if not os.path.isdir(d):
continue continue
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment