Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
70d00f6f
P
PaddleDetection
项目概览
s920243400
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
70d00f6f
编写于
7月 13, 2022
作者:
S
shangliang Xu
提交者:
GitHub
7月 13, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[dev] fix bug in _download_dist (#6419)
上级
6c59641e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
6 deletion
+8
-6
ppdet/utils/download.py
ppdet/utils/download.py
+7
-5
test_tipc/test_train_inference_python.sh
test_tipc/test_train_inference_python.sh
+1
-1
未找到文件。
ppdet/utils/download.py
浏览文件 @
70d00f6f
...
...
@@ -393,7 +393,12 @@ def _download(url, path, md5sum=None):
def
_download_dist
(
url
,
path
,
md5sum
=
None
):
env
=
os
.
environ
if
'PADDLE_TRAINERS_NUM'
in
env
and
'PADDLE_TRAINER_ID'
in
env
:
trainer_id
=
int
(
env
[
'PADDLE_TRAINER_ID'
])
# Mainly used to solve the problem of downloading data from
# different machines in the case of multiple machines.
# Different nodes will download data, and the same node
# will only download data once.
# Reference https://github.com/PaddlePaddle/PaddleClas/blob/develop/ppcls/utils/download.py#L108
rank_id_curr_node
=
int
(
os
.
environ
.
get
(
"PADDLE_RANK_IN_NODE"
,
0
))
num_trainers
=
int
(
env
[
'PADDLE_TRAINERS_NUM'
])
if
num_trainers
<=
1
:
return
_download
(
url
,
path
,
md5sum
)
...
...
@@ -406,12 +411,9 @@ def _download_dist(url, path, md5sum=None):
os
.
makedirs
(
path
)
if
not
osp
.
exists
(
fullname
):
from
paddle.distributed
import
ParallelEnv
unique_endpoints
=
_get_unique_endpoints
(
ParallelEnv
()
.
trainer_endpoints
[:])
with
open
(
lock_path
,
'w'
):
# touch
os
.
utime
(
lock_path
,
None
)
if
ParallelEnv
().
current_endpoint
in
unique_endpoints
:
if
rank_id_curr_node
==
0
:
_download
(
url
,
path
,
md5sum
)
os
.
remove
(
lock_path
)
else
:
...
...
test_tipc/test_train_inference_python.sh
浏览文件 @
70d00f6f
...
...
@@ -262,7 +262,7 @@ else
continue
fi
if
[
${
autocast
}
=
"amp"
]
;
then
if
[
${
autocast
}
=
"amp"
]
||
[
${
autocast
}
=
"fp16"
]
;
then
set_autocast
=
"--amp"
else
set_autocast
=
" "
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录