Skip to content

Commit

Permalink
Fix invalid argument error when using lsun method in windows (#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanvach authored and soumith committed May 18, 2018
1 parent 2e25533 commit 55d7395
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchvision/datasets/lsun.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, root, transform=None, target_transform=None):
readahead=False, meminit=False)
with self.env.begin(write=False) as txn:
self.length = txn.stat()['entries']
cache_file = '_cache_' + root.replace('/', '_')
cache_file = '_cache_' + ''.join(c for c in root if c in string.ascii_letters)
if os.path.isfile(cache_file):
self.keys = pickle.load(open(cache_file, "rb"))
else:
Expand Down

0 comments on commit 55d7395

Please sign in to comment.