Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
553659a5
M
models
项目概览
PaddlePaddle
/
models
大约 1 年 前同步成功
通知
222
Star
6828
Fork
2962
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
602
列表
看板
标记
里程碑
合并请求
255
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
602
Issue
602
列表
看板
标记
里程碑
合并请求
255
合并请求
255
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
553659a5
编写于
7月 01, 2019
作者:
C
chengduo
提交者:
GitHub
7月 01, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
yolov3 is a special model, if num_trainers > 1, each process trian the completed dataset (#2605)
上级
931b0135
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
13 addition
and
12 deletion
+13
-12
PaddleCV/yolov3/reader.py
PaddleCV/yolov3/reader.py
+9
-7
PaddleCV/yolov3/train.py
PaddleCV/yolov3/train.py
+4
-5
未找到文件。
PaddleCV/yolov3/reader.py
浏览文件 @
553659a5
...
...
@@ -272,13 +272,15 @@ class DataSetReader(object):
batch_out
=
[(
im
,
im_id
,
im_shape
)]
yield
batch_out
num_trainers
=
int
(
os
.
environ
.
get
(
'PADDLE_TRAINERS_NUM'
,
1
))
if
mode
==
'train'
and
num_trainers
>
1
:
assert
shuffle_seed
is
not
None
,
\
"If num_trainers > 1, the shuffle_seed must be set, because "
\
"the order of batch data generated by reader "
\
"must be the same in the respective processes."
reader
=
fluid
.
contrib
.
reader
.
distributed_batch_reader
(
reader
)
# NOTE: yolov3 is a special model, if num_trainers > 1, each process
# trian the completed dataset.
# num_trainers = int(os.environ.get('PADDLE_TRAINERS_NUM', 1))
# if mode == 'train' and num_trainers > 1:
# assert shuffle_seed is not None, \
# "If num_trainers > 1, the shuffle_seed must be set, because " \
# "the order of batch data generated by reader " \
# "must be the same in the respective processes."
# reader = fluid.contrib.reader.distributed_batch_reader(reader)
return
reader
...
...
PaddleCV/yolov3/train.py
浏览文件 @
553659a5
...
...
@@ -47,7 +47,6 @@ import dist_utils
num_trainers
=
int
(
os
.
environ
.
get
(
'PADDLE_TRAINERS_NUM'
,
1
))
def
get_device_num
():
# NOTE(zcd): for multi-processe training, each process use one GPU card.
if
num_trainers
>
1
:
return
1
...
...
@@ -141,10 +140,10 @@ def train():
shuffle
=
True
if
args
.
enable_ce
:
shuffle
=
False
# NOTE: If num_trainers > 1, the shuffle_seed must be set, becaus
e
#
the order of batch data generated by reader
#
must be the same in the respective processes
.
shuffle_seed
=
1
if
num_trainers
>
1
else
None
shuffle_seed
=
Non
e
#
NOTE: yolov3 is a special model, if num_trainers > 1, each process
#
trian the completed dataset
.
# if num_trainers > 1: shuffle_seed = 1
train_reader
=
reader
.
train
(
input_size
,
batch_size
=
cfg
.
batch_size
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录