Commit 8aec85de authored by Tongzhou Wang's avatar Tongzhou Wang Committed by Francisco Massa
Browse files

DatasetFolder should follow links when searching for data (#1580)

parent abeecb35
...@@ -44,7 +44,7 @@ def make_dataset(dir, class_to_idx, extensions=None, is_valid_file=None): ...@@ -44,7 +44,7 @@ def make_dataset(dir, class_to_idx, extensions=None, is_valid_file=None):
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
for root, _, fnames in sorted(os.walk(d)): for root, _, fnames in sorted(os.walk(d, followlinks=True)):
for fname in sorted(fnames): for fname in sorted(fnames):
path = os.path.join(root, fname) path = os.path.join(root, fname)
if is_valid_file(path): if is_valid_file(path):
......
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