Skip to content

Commit

Permalink
Fix archive filename
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony-Y committed Apr 29, 2024
1 parent cf8b85b commit 65f9445
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion examples/emnist/download.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import torchvision
from torchvision.datasets.utils import download_url
import os

Expand All @@ -6,8 +7,14 @@
url = 'https://biometrics.nist.gov/cs_links/EMNIST/gzip.zip'
md5 = "58c8d27c78d21e728a6bc7b3cc06412e"

version_numbers = list(map(int, torchvision.__version__.split('+')[0].split('.')))
if version_numbers[0] == 0 and version_numbers[1] < 10:
filename = "emnist.zip"
else:
filename = None

os.makedirs(raw_folder, exist_ok=True)

# download files
print('Downloading zip archive')
download_url(url, root=raw_folder, filename="emnist.zip", md5=md5)
download_url(url, root=raw_folder, filename=filename, md5=md5)

0 comments on commit 65f9445

Please sign in to comment.