Skip to content

Commit

Permalink
Merge pull request #5181 from willyd/download-model-py3
Browse files Browse the repository at this point in the history
Python 2/3 compatible download_model_binary.py
  • Loading branch information
shelhamer committed Jan 17, 2017
2 parents 536851c + 91c15e8 commit 8065c18
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/download_model_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import sys
import time
import yaml
import urllib
import hashlib
import argparse

from six.moves import urllib

required_keys = ['caffemodel', 'caffemodel_url', 'sha1']


Expand Down Expand Up @@ -69,7 +70,7 @@ def model_checks_out(filename=model_filename, sha1=frontmatter['sha1']):
sys.exit(0)

# Download and verify model.
urllib.urlretrieve(
urllib.request.urlretrieve(
frontmatter['caffemodel_url'], model_filename, reporthook)
if not model_checks_out():
print('ERROR: model did not download correctly! Run this again.')
Expand Down

0 comments on commit 8065c18

Please sign in to comment.