diff --git a/ppdet/utils/download.py b/ppdet/utils/download.py index c915174e354585aac25bdd3e680e426e2d29d89b..daa2793b78be25f19a722f463b2eb7581d75df35 100644 --- a/ppdet/utils/download.py +++ b/ppdet/utils/download.py @@ -18,6 +18,7 @@ from __future__ import print_function import os import os.path as osp +import sys import yaml import shutil import requests @@ -349,6 +350,11 @@ def _download(url, path, md5sum=None): logger.info("Downloading {} from {}".format(fname, url)) + + # NOTE: windows path join may incur \, which is invalid in url + if sys.platform == "win32": + url = url.replace('\\', '/') + req = requests.get(url, stream=True) if req.status_code != 200: raise RuntimeError("Downloading from {} failed with code "