From d49a0d755b6fa74c5cda9915f9238d600916c9d9 Mon Sep 17 00:00:00 2001 From: minqiyang Date: Wed, 22 Aug 2018 20:57:17 +0800 Subject: [PATCH] Fix common download problem --- python/paddle/dataset/common.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/paddle/dataset/common.py b/python/paddle/dataset/common.py index 1d7ff582c86..ece4046f5b7 100644 --- a/python/paddle/dataset/common.py +++ b/python/paddle/dataset/common.py @@ -19,6 +19,7 @@ import hashlib import os import errno import shutil +import six import sys import importlib import paddle.dataset @@ -94,6 +95,8 @@ def download(url, module_name, md5sum, save_name=None): dl = 0 total_length = int(total_length) for data in r.iter_content(chunk_size=4096): + if six.PY2: + data = six.b(data) dl += len(data) f.write(data) done = int(50 * dl / total_length) -- GitLab