Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
pingzhuyan
mindspore
提交
869ca261
M
mindspore
项目概览
pingzhuyan
/
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
869ca261
编写于
9月 02, 2020
作者:
L
Li Hongzhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rm unused params for SummaryRecord
上级
2f3684d4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
5 addition
and
27 deletion
+5
-27
mindspore/train/summary/_writer_pool.py
mindspore/train/summary/_writer_pool.py
+2
-1
mindspore/train/summary/summary_record.py
mindspore/train/summary/summary_record.py
+3
-26
未找到文件。
mindspore/train/summary/_writer_pool.py
浏览文件 @
869ca261
...
...
@@ -53,7 +53,8 @@ class WriterPool(ctx.Process):
Args:
base_dir (str): The base directory to hold all the files.
filelist (str): The mapping from short name to long filename.
max_file_size (Optional[int]): The maximum size of each file that can be written to disk in bytes.
filedict (dict): The mapping from plugin to filename.
"""
def
__init__
(
self
,
base_dir
,
max_file_size
,
**
filedict
)
->
None
:
...
...
mindspore/train/summary/summary_record.py
浏览文件 @
869ca261
...
...
@@ -75,8 +75,6 @@ class SummaryRecord:
Args:
log_dir (str): The log_dir is a directory location to save the summary.
queue_max_size (int): Deprecated. The capacity of event queue.(reserved). Default: 0.
flush_time (int): Deprecated. Frequency of flush the summary file to disk. The unit is second. Default: 120.
file_prefix (str): The prefix of file. Default: "events".
file_suffix (str): The suffix of file. Default: "_MS".
network (Cell): Obtain a pipeline through network for saving graph summary. Default: None.
...
...
@@ -84,8 +82,7 @@ class SummaryRecord:
Unlimited by default. For example, to write not larger than 4GB, specify `max_file_size=4 * 1024**3`.
Raises:
TypeError: If the data type of `max_file_size`, `queue_max_size` or `flush_time` is not int,
\
or the data type of `file_prefix` and `file_suffix` is not str.
TypeError: If the type of `max_file_size` is not int, or the type of `file_prefix` or `file_suffix` is not str.
RuntimeError: If the log_dir is not a normalized absolute path name.
Examples:
...
...
@@ -100,14 +97,7 @@ class SummaryRecord:
>>> summary_record.close()
"""
def
__init__
(
self
,
log_dir
,
queue_max_size
=
0
,
flush_time
=
120
,
file_prefix
=
"events"
,
file_suffix
=
"_MS"
,
network
=
None
,
max_file_size
=
None
):
def
__init__
(
self
,
log_dir
,
file_prefix
=
"events"
,
file_suffix
=
"_MS"
,
network
=
None
,
max_file_size
=
None
):
self
.
_closed
,
self
.
_event_writer
=
False
,
None
self
.
_mode
,
self
.
_data_pool
=
'train'
,
_dictlist
()
...
...
@@ -120,8 +110,6 @@ class SummaryRecord:
if
not
isinstance
(
max_file_size
,
(
int
,
type
(
None
))):
raise
TypeError
(
"The 'max_file_size' should be int type."
)
if
not
isinstance
(
queue_max_size
,
int
)
or
not
isinstance
(
flush_time
,
int
):
raise
TypeError
(
"`queue_max_size` and `flush_time` should be int"
)
if
not
isinstance
(
file_prefix
,
str
)
or
not
isinstance
(
file_suffix
,
str
):
raise
TypeError
(
"`file_prefix` and `file_suffix` should be str."
)
...
...
@@ -129,17 +117,6 @@ class SummaryRecord:
logger
.
warning
(
"The 'max_file_size' should be greater than 0."
)
max_file_size
=
None
self
.
queue_max_size
=
queue_max_size
if
queue_max_size
<
0
:
# 0 is not limit
logger
.
warning
(
"The queue_max_size(%r) set error, will use the default value: 0"
,
queue_max_size
)
self
.
queue_max_size
=
0
self
.
flush_time
=
flush_time
if
flush_time
<=
0
:
logger
.
warning
(
"The flush_time(%r) set error, will use the default value: 120"
,
flush_time
)
self
.
flush_time
=
120
self
.
prefix
=
file_prefix
self
.
suffix
=
file_suffix
self
.
network
=
network
...
...
@@ -155,7 +132,7 @@ class SummaryRecord:
self
.
_event_writer
=
WriterPool
(
log_dir
,
max_file_size
,
summary
=
self
.
full_file_name
,
lineage
=
get_event_file_name
(
'events'
,
'_lineage'
))
lineage
=
get_event_file_name
(
self
.
prefix
,
'_lineage'
))
_get_summary_tensor_data
()
atexit
.
register
(
self
.
close
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录