未验证 提交 3f3ce129 编写于 作者: K Kaipeng Deng 提交者: GitHub

fix remove weights on re-download (#1722)

上级 a4b4e716
...@@ -213,7 +213,10 @@ def get_path(url, root_dir, md5sum=None, check_exist=True): ...@@ -213,7 +213,10 @@ def get_path(url, root_dir, md5sum=None, check_exist=True):
logger.debug("Found {}".format(fullpath)) logger.debug("Found {}".format(fullpath))
return fullpath, True return fullpath, True
else: else:
shutil.rmtree(fullpath) if osp.isdir(fullpath):
shutil.rmtree(fullpath)
else:
os.remove(fullpath)
fullname = _download(url, root_dir, md5sum) fullname = _download(url, root_dir, md5sum)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册