Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
23674478
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
23674478
编写于
8月 04, 2021
作者:
K
Kaipeng Deng
提交者:
GitHub
8月 04, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix download hang (#3874)
上级
8d31a3df
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
16 addition
and
4 deletion
+16
-4
ppdet/utils/download.py
ppdet/utils/download.py
+16
-4
未找到文件。
ppdet/utils/download.py
浏览文件 @
23674478
...
@@ -412,7 +412,7 @@ def _download_dist(url, path, md5sum=None):
...
@@ -412,7 +412,7 @@ def _download_dist(url, path, md5sum=None):
os
.
remove
(
lock_path
)
os
.
remove
(
lock_path
)
else
:
else
:
while
os
.
path
.
exists
(
lock_path
):
while
os
.
path
.
exists
(
lock_path
):
time
.
sleep
(
1
)
time
.
sleep
(
0.5
)
return
fullname
return
fullname
else
:
else
:
return
_download
(
url
,
path
,
md5sum
)
return
_download
(
url
,
path
,
md5sum
)
...
@@ -507,14 +507,26 @@ def _decompress_dist(fname):
...
@@ -507,14 +507,26 @@ def _decompress_dist(fname):
from
paddle.distributed
import
ParallelEnv
from
paddle.distributed
import
ParallelEnv
unique_endpoints
=
_get_unique_endpoints
(
ParallelEnv
()
unique_endpoints
=
_get_unique_endpoints
(
ParallelEnv
()
.
trainer_endpoints
[:])
.
trainer_endpoints
[:])
# NOTE(dkp): _decompress_dist always performed after
# _download_dist, in _download_dist sub-trainers is waiting
# for download lock file release with sleeping, if decompress
# prograss is very fast and finished with in the sleeping gap
# time, e.g in tiny dataset such as coco_ce, spine_coco, main
# trainer may finish decompress and release lock file, so we
# only craete lock file in main trainer and all sub-trainer
# wait 1s for main trainer to create lock file, for 1s is
# twice as sleeping gap, this waiting time can keep all
# trainer pipeline in order
# **change this if you have more elegent methods**
if
ParallelEnv
().
current_endpoint
in
unique_endpoints
:
with
open
(
lock_path
,
'w'
):
# touch
with
open
(
lock_path
,
'w'
):
# touch
os
.
utime
(
lock_path
,
None
)
os
.
utime
(
lock_path
,
None
)
if
ParallelEnv
().
current_endpoint
in
unique_endpoints
:
_decompress
(
fname
)
_decompress
(
fname
)
os
.
remove
(
lock_path
)
os
.
remove
(
lock_path
)
else
:
else
:
while
os
.
path
.
exists
(
lock_path
):
time
.
sleep
(
1
)
time
.
sleep
(
1
)
while
os
.
path
.
exists
(
lock_path
):
time
.
sleep
(
0.5
)
else
:
else
:
_decompress
(
fname
)
_decompress
(
fname
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录