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

fix remove weights on re-download (#1721)

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