Skip to content

Commit

Permalink
Python 2/3 compatible download_model_binary.py
Browse files Browse the repository at this point in the history
  • Loading branch information
willyd committed Jan 13, 2017
1 parent 365ac88 commit 91c15e8
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 91c15e8

Please sign in to comment.