Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
b0620a7b
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看板
未验证
提交
b0620a7b
编写于
10月 26, 2022
作者:
G
Guanghua Yu
提交者:
GitHub
10月 26, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
correct the use of all_reduce (#7108) (#7199)
上级
e066d8d1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
36 deletion
+7
-36
ppdet/modeling/heads/gfl_head.py
ppdet/modeling/heads/gfl_head.py
+1
-6
ppdet/modeling/heads/simota_head.py
ppdet/modeling/heads/simota_head.py
+6
-30
未找到文件。
ppdet/modeling/heads/gfl_head.py
浏览文件 @
b0620a7b
...
...
@@ -388,12 +388,7 @@ class GFLHead(nn.Layer):
avg_factor
=
sum
(
avg_factor
)
try
:
avg_factor_clone
=
avg_factor
.
clone
()
tmp_avg_factor
=
paddle
.
distributed
.
all_reduce
(
avg_factor_clone
)
if
tmp_avg_factor
is
not
None
:
avg_factor
=
tmp_avg_factor
else
:
avg_factor
=
avg_factor_clone
paddle
.
distributed
.
all_reduce
(
avg_factor
)
avg_factor
=
paddle
.
clip
(
avg_factor
/
paddle
.
distributed
.
get_world_size
(),
min
=
1
)
except
:
...
...
ppdet/modeling/heads/simota_head.py
浏览文件 @
b0620a7b
...
...
@@ -179,15 +179,8 @@ class OTAHead(GFLHead):
num_level_anchors
)
num_total_pos
=
sum
(
pos_num_l
)
try
:
cloned_num_total_pos
=
num_total_pos
.
clone
()
reduced_cloned_num_total_pos
=
paddle
.
distributed
.
all_reduce
(
cloned_num_total_pos
)
if
reduced_cloned_num_total_pos
is
not
None
:
num_total_pos
=
reduced_cloned_num_total_pos
/
paddle
.
distributed
.
get_world_size
(
)
else
:
num_total_pos
=
cloned_num_total_pos
/
paddle
.
distributed
.
get_world_size
(
)
paddle
.
distributed
.
all_reduce
(
num_total_pos
)
num_total_pos
=
num_total_pos
/
paddle
.
distributed
.
get_world_size
()
except
:
num_total_pos
=
max
(
num_total_pos
,
1
)
...
...
@@ -262,12 +255,7 @@ class OTAHead(GFLHead):
avg_factor
=
sum
(
avg_factor
)
try
:
avg_factor_clone
=
avg_factor
.
clone
()
tmp_avg_factor
=
paddle
.
distributed
.
all_reduce
(
avg_factor_clone
)
if
tmp_avg_factor
is
not
None
:
avg_factor
=
tmp_avg_factor
else
:
avg_factor
=
avg_factor_clone
paddle
.
distributed
.
all_reduce
(
avg_factor
)
avg_factor
=
paddle
.
clip
(
avg_factor
/
paddle
.
distributed
.
get_world_size
(),
min
=
1
)
except
:
...
...
@@ -408,15 +396,8 @@ class OTAVFLHead(OTAHead):
num_level_anchors
)
num_total_pos
=
sum
(
pos_num_l
)
try
:
cloned_num_total_pos
=
num_total_pos
.
clone
()
reduced_cloned_num_total_pos
=
paddle
.
distributed
.
all_reduce
(
cloned_num_total_pos
)
if
reduced_cloned_num_total_pos
is
not
None
:
num_total_pos
=
reduced_cloned_num_total_pos
/
paddle
.
distributed
.
get_world_size
(
)
else
:
num_total_pos
=
cloned_num_total_pos
/
paddle
.
distributed
.
get_world_size
(
)
paddle
.
distributed
.
all_reduce
(
num_total_pos
)
num_total_pos
=
num_total_pos
/
paddle
.
distributed
.
get_world_size
()
except
:
num_total_pos
=
max
(
num_total_pos
,
1
)
...
...
@@ -494,12 +475,7 @@ class OTAVFLHead(OTAHead):
avg_factor
=
sum
(
avg_factor
)
try
:
avg_factor_clone
=
avg_factor
.
clone
()
tmp_avg_factor
=
paddle
.
distributed
.
all_reduce
(
avg_factor_clone
)
if
tmp_avg_factor
is
not
None
:
avg_factor
=
tmp_avg_factor
else
:
avg_factor
=
avg_factor_clone
paddle
.
distributed
.
all_reduce
(
avg_factor
)
avg_factor
=
paddle
.
clip
(
avg_factor
/
paddle
.
distributed
.
get_world_size
(),
min
=
1
)
except
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录