Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
ef5c4197
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看板
提交
ef5c4197
编写于
5月 11, 2020
作者:
D
dengkaipeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
not reset when max_iters unset
上级
91823e97
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
5 addition
and
3 deletion
+5
-3
ppdet/data/parallel_map.py
ppdet/data/parallel_map.py
+2
-2
ppdet/data/reader.py
ppdet/data/reader.py
+3
-1
未找到文件。
ppdet/data/parallel_map.py
浏览文件 @
ef5c4197
...
@@ -119,7 +119,7 @@ class ParallelMap(object):
...
@@ -119,7 +119,7 @@ class ParallelMap(object):
self
.
_producer
=
threading
.
Thread
(
self
.
_producer
=
threading
.
Thread
(
target
=
self
.
_produce
,
target
=
self
.
_produce
,
args
=
(
'producer-'
+
id
,
self
.
_source
,
self
.
_inq
))
args
=
(
'producer-'
+
id
,
self
.
_source
,
self
.
_inq
))
self
.
_producer
.
daemon
=
Fals
e
self
.
_producer
.
daemon
=
Tru
e
self
.
_consumers
=
[]
self
.
_consumers
=
[]
self
.
_consumer_endsig
=
{}
self
.
_consumer_endsig
=
{}
...
@@ -130,7 +130,7 @@ class ParallelMap(object):
...
@@ -130,7 +130,7 @@ class ParallelMap(object):
target
=
self
.
_consume
,
target
=
self
.
_consume
,
args
=
(
consumer_id
,
self
.
_inq
,
self
.
_outq
,
self
.
_worker
))
args
=
(
consumer_id
,
self
.
_inq
,
self
.
_outq
,
self
.
_worker
))
self
.
_consumers
.
append
(
p
)
self
.
_consumers
.
append
(
p
)
p
.
daemon
=
use_process
p
.
daemon
=
True
setattr
(
p
,
'id'
,
consumer_id
)
setattr
(
p
,
'id'
,
consumer_id
)
if
use_process
:
if
use_process
:
worker_set
.
add
(
p
)
worker_set
.
add
(
p
)
...
...
ppdet/data/reader.py
浏览文件 @
ef5c4197
...
@@ -304,9 +304,11 @@ class Reader(object):
...
@@ -304,9 +304,11 @@ class Reader(object):
if
self
.
_epoch
<
0
:
if
self
.
_epoch
<
0
:
self
.
reset
()
self
.
reset
()
if
self
.
drained
():
if
self
.
drained
():
self
.
stop
()
raise
StopIteration
raise
StopIteration
batch
=
self
.
_load_batch
()
batch
=
self
.
_load_batch
()
if
self
.
_drop_last
and
len
(
batch
)
<
self
.
_batch_size
:
if
self
.
_drop_last
and
len
(
batch
)
<
self
.
_batch_size
:
self
.
stop
()
raise
StopIteration
raise
StopIteration
if
self
.
_worker_num
>
-
1
:
if
self
.
_worker_num
>
-
1
:
return
batch
return
batch
...
@@ -418,8 +420,8 @@ def create_reader(cfg, max_iter=0, global_cfg=None, devices_num=1):
...
@@ -418,8 +420,8 @@ def create_reader(cfg, max_iter=0, global_cfg=None, devices_num=1):
n
+=
1
n
+=
1
if
max_iter
>
0
and
n
==
max_iter
:
if
max_iter
>
0
and
n
==
max_iter
:
return
return
reader
.
reset
()
if
max_iter
<=
0
:
if
max_iter
<=
0
:
return
return
reader
.
reset
()
return
_reader
return
_reader
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录