Skip to content

Commit 91c15e8

Browse files
committed
Python 2/3 compatible download_model_binary.py
1 parent 365ac88 commit 91c15e8

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

scripts/download_model_binary.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
import sys
44
import time
55
import yaml
6-
import urllib
76
import hashlib
87
import argparse
98

9+
from six.moves import urllib
10+
1011
required_keys = ['caffemodel', 'caffemodel_url', 'sha1']
1112

1213

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

7172
# Download and verify model.
72-
urllib.urlretrieve(
73+
urllib.request.urlretrieve(
7374
frontmatter['caffemodel_url'], model_filename, reporthook)
7475
if not model_checks_out():
7576
print('ERROR: model did not download correctly! Run this again.')

0 commit comments

Comments
 (0)