Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions download.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from os.path import join

import subprocess
import urllib2
from six.moves.urllib.request import urlopen

__author__ = 'Fisher Yu'
__email__ = 'fy@cs.princeton.edu'
Expand All @@ -16,7 +16,7 @@

def list_categories(tag):
url = 'http://lsun.cs.princeton.edu/htbin/list.cgi?tag=' + tag
f = urllib2.urlopen(url)
f = urlopen(url)
return json.loads(f.read())


Expand Down Expand Up @@ -51,8 +51,8 @@ def main():
if args.category == 'test':
download(args.out_dir, '', 'test', args.tag)
elif args.category not in categories:
print('Error:', args.category, "doesn't exist in",
args.tag, 'LSUN release')
print('Error:', args.category, "doesn't exist in", args.tag,
'LSUN release')
else:
download(args.out_dir, args.category, 'train', args.tag)
download(args.out_dir, args.category, 'val', args.tag)
Expand Down