Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_44025039
mindspore
提交
706f32a9
M
mindspore
项目概览
weixin_44025039
/
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,发现更多精彩内容 >>
提交
706f32a9
编写于
9月 08, 2020
作者:
L
liuyang_655
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify eval
上级
b7425d3e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
8 addition
and
5 deletion
+8
-5
mindspore/train/model.py
mindspore/train/model.py
+8
-5
未找到文件。
mindspore/train/model.py
浏览文件 @
706f32a9
...
...
@@ -535,10 +535,9 @@ class Model:
"""
Training API where the iteration is controlled by python front-end.
When setting pynative mode, the training process will be performed with dataset not sink.
When setting pynative mode
or CPU
, the training process will be performed with dataset not sink.
Note:
CPU is not supported when dataset_sink_mode is true.
If dataset_sink_mode is True, epoch of training should be equal to the count of repeat
operation in dataset processing. Otherwise, errors could occur since the amount of data
is not equal to the required amount of training .
...
...
@@ -558,7 +557,7 @@ class Model:
function respectively.
callbacks (list): List of callback objects which should be executed while training. Default: None.
dataset_sink_mode (bool): Determines whether to pass the data through dataset channel. Default: True.
Configure pynative mode, the training process will be performed with
Configure pynative mode
or CPU
, the training process will be performed with
dataset not sink.
sink_size (int): Control the amount of data in each sink.
If sink_size = -1, sink the complete dataset for each epoch.
...
...
@@ -667,10 +666,9 @@ class Model:
"""
Evaluation API where the iteration is controlled by python front-end.
Configure to pynative mode
, the evaluation
will be performed with dataset non-sink mode.
Configure to pynative mode
or CPU, the evaluating process
will be performed with dataset non-sink mode.
Note:
CPU is not supported when dataset_sink_mode is true.
If dataset_sink_mode is True, data will be sent to device. If device is Ascend, features
of data will be transferred one by one. The limitation of data transmission per time is 256M.
...
...
@@ -708,6 +706,11 @@ class Model:
self
.
_clear_metrics
()
if
context
.
get_context
(
"device_target"
)
==
"CPU"
:
dataset_sink_mode
=
False
logger
.
warning
(
"CPU cannot support dataset sink mode currently."
"So the evaluating process will be performed with dataset non-sink mode."
)
with
_CallbackManager
(
callbacks
)
as
list_callback
:
if
dataset_sink_mode
:
return
self
.
_eval_dataset_sink_process
(
valid_dataset
,
list_callback
,
cb_params
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录