Skip to content

Commit 520cd3a

Browse files
committed
Add check for successful download.
1 parent 879fe88 commit 520cd3a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

content/tutorial-deep-learning-on-mnist.md

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ for fname in data_sources.values():
9797
if not os.path.exists(fpath):
9898
print("Downloading file: " + fname)
9999
resp = requests.get(base_url + fname, stream=True, **request_opts)
100+
resp.raise_for_status() # Ensure download was succesful
100101
with open(fpath, "wb") as fh:
101102
for chunk in resp.iter_content(chunk_size=128):
102103
fh.write(chunk)

0 commit comments

Comments
 (0)