From 88e8403bfba298a0a0934d4899954f6488a937c0 Mon Sep 17 00:00:00 2001 From: Joao Felipe Santos Date: Sun, 19 Apr 2015 11:19:09 -0400 Subject: [PATCH] Fixed data_utils to work with Python 2 and 3 --- keras/datasets/data_utils.py | 6 +++--- setup.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/keras/datasets/data_utils.py b/keras/datasets/data_utils.py index 65b423c4e..9e868a735 100644 --- a/keras/datasets/data_utils.py +++ b/keras/datasets/data_utils.py @@ -1,7 +1,7 @@ from __future__ import absolute_import from __future__ import print_function -import urllib, tarfile -import inspect, os +import tarfile, inspect, os +from six.moves.urllib.request import urlretrieve from ..utils.generic_utils import Progbar def get_file(fname, origin, untar=False): @@ -29,7 +29,7 @@ def get_file(fname, origin, untar=False): else: progbar.update(count*block_size) - urllib.urlretrieve(origin, fpath, dl_progress) + urlretrieve(origin, fpath, dl_progress) progbar = None if untar: diff --git a/setup.py b/setup.py index 7122f12a4..1b2eedcf3 100644 --- a/setup.py +++ b/setup.py @@ -10,4 +10,4 @@ setup(name='Keras', license='MIT', packages=find_packages(), # TODO: dependencies -) \ No newline at end of file +)