Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
bc426854
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
bc426854
编写于
7月 02, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
7月 02, 2020
浏览文件
操作
浏览文件
下载
差异文件
!2770 Capture the time before hand over to the processes pool to avoid time flips
Merge pull request !2770 from LiHongzhang/capture_time
上级
16d431ee
f9c6d12b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
6 deletion
+7
-6
mindspore/train/summary/_summary_adapter.py
mindspore/train/summary/_summary_adapter.py
+2
-2
mindspore/train/summary/_writer_pool.py
mindspore/train/summary/_writer_pool.py
+5
-4
未找到文件。
mindspore/train/summary/_summary_adapter.py
浏览文件 @
bc426854
...
...
@@ -91,7 +91,7 @@ def package_graph_event(data):
return
graph_event
def
package_summary_event
(
data_list
,
step
):
def
package_summary_event
(
data_list
,
step
,
wall_time
):
"""
Package the summary to event protobuffer.
...
...
@@ -105,7 +105,7 @@ def package_summary_event(data_list, step):
# create the event of summary
summary_event
=
Event
()
summary
=
summary_event
.
summary
summary_event
.
wall_time
=
time
.
time
()
summary_event
.
wall_time
=
wall_time
summary_event
.
step
=
int
(
step
)
for
value
in
data_list
:
...
...
mindspore/train/summary/_writer_pool.py
浏览文件 @
bc426854
...
...
@@ -14,15 +14,16 @@
# ============================================================================
"""Write events to disk in a base directory."""
import
os
import
time
from
collections
import
deque
from
multiprocessing
import
Pool
,
Process
,
Queue
,
cpu_count
from
._lineage_adapter
import
serialize_to_lineage_event
from
._summary_adapter
import
package_graph_event
,
package_summary_event
from
._summary_writer
import
SummaryWriter
,
Lineage
Writer
from
._summary_writer
import
LineageWriter
,
Summary
Writer
def
_pack_data
(
datadict
):
def
_pack_data
(
datadict
,
wall_time
):
"""Pack data according to which plugin."""
result
=
[]
summaries
,
step
,
mode
=
[],
None
,
None
...
...
@@ -37,7 +38,7 @@ def _pack_data(datadict):
step
=
data
.
get
(
'step'
)
mode
=
data
.
get
(
'mode'
)
if
summaries
:
result
.
append
([
'summary'
,
mode
,
package_summary_event
(
summaries
,
step
).
SerializeToString
()])
result
.
append
([
'summary'
,
mode
,
package_summary_event
(
summaries
,
step
,
wall_time
).
SerializeToString
()])
return
result
...
...
@@ -70,7 +71,7 @@ class WriterPool(Process):
if
not
self
.
_queue
.
empty
():
action
,
data
=
self
.
_queue
.
get
()
if
action
==
'WRITE'
:
deq
.
append
(
pool
.
apply_async
(
_pack_data
,
(
data
,)))
deq
.
append
(
pool
.
apply_async
(
_pack_data
,
(
data
,
time
.
time
()
)))
elif
action
==
'FLUSH'
:
for
writer
in
writers
:
writer
.
flush
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录