Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
09142f60
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看板
提交
09142f60
编写于
9月 05, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
9月 05, 2020
浏览文件
操作
浏览文件
下载
差异文件
!5798 [MSLITE]schema add version and fix the version function bug
Merge pull request !5798 from zhaodezan/master
上级
f0c07bbc
b6493c20
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
17 addition
and
9 deletion
+17
-9
build.sh
build.sh
+3
-3
mindspore/lite/include/version.h
mindspore/lite/include/version.h
+6
-6
mindspore/lite/schema/model.fbs
mindspore/lite/schema/model.fbs
+1
-0
mindspore/lite/tools/benchmark/benchmark.cc
mindspore/lite/tools/benchmark/benchmark.cc
+5
-0
mindspore/lite/tools/converter/converter.cc
mindspore/lite/tools/converter/converter.cc
+2
-0
未找到文件。
build.sh
浏览文件 @
09142f60
...
...
@@ -571,9 +571,9 @@ build_minddata_lite_deps()
build_lite
()
{
VERSION_MAJOR
=
`
grep
"
#define MS_VERSION_MAJOR
"
mindspore/lite/include/version.h |
tr
-dc
"[0-9]"
`
VERSION_MINOR
=
`
grep
"
#define MS_VERSION_MINOR
"
mindspore/lite/include/version.h |
tr
-dc
"[0-9]"
`
VERSION_REVISION
=
`
grep
"
#define MS_VERSION_REVISION
"
mindspore/lite/include/version.h |
tr
-dc
"[0-9]"
`
VERSION_MAJOR
=
`
grep
"
const int ms_version_major =
"
mindspore/lite/include/version.h |
tr
-dc
"[0-9]"
`
VERSION_MINOR
=
`
grep
"
const int ms_version_minor =
"
mindspore/lite/include/version.h |
tr
-dc
"[0-9]"
`
VERSION_REVISION
=
`
grep
"
const int ms_version_revision =
"
mindspore/lite/include/version.h |
tr
-dc
"[0-9]"
`
echo
"============ Start building MindSpore Lite
${
VERSION_MAJOR
}
.
${
VERSION_MINOR
}
.
${
VERSION_REVISION
}
============"
if
[
"
${
ENABLE_GPU
}
"
==
"on"
]
&&
[
"
${
LITE_PLATFORM
}
"
==
"arm64"
]
;
then
echo
"start build opencl"
...
...
mindspore/lite/include/version.h
浏览文件 @
09142f60
...
...
@@ -21,16 +21,16 @@
namespace
mindspore
{
namespace
lite
{
#define MS_VERSION_MAJOR 0
#define MS_VERSION_MINOR 7
#define MS_VERSION_REVISION 0
const
int
ms_version_major
=
0
;
const
int
ms_version_minor
=
7
;
const
int
ms_version_revision
=
0
;
/// \brief Global method to get a version string.
///
/// \return The version string of MindSpore Lite.
std
::
string
Version
()
{
return
"MindSpore Lite "
+
std
::
to_string
(
MS_VERSION_MAJOR
)
+
"."
+
std
::
to_string
(
MS_VERSION_MINOR
)
+
"."
+
std
::
to_string
(
MS_VERSION_REVISION
);
inline
std
::
string
Version
()
{
return
"MindSpore Lite "
+
std
::
to_string
(
ms_version_major
)
+
"."
+
std
::
to_string
(
ms_version_minor
)
+
"."
+
std
::
to_string
(
ms_version_revision
);
}
}
// namespace lite
}
// namespace mindspore
...
...
mindspore/lite/schema/model.fbs
浏览文件 @
09142f60
...
...
@@ -219,6 +219,7 @@ table CNode {
table MetaGraph {
name: string;
version: string;
fmkType: int; // 0:tf,1:caffe
inputIndex: [uint];
outputIndex: [uint];
...
...
mindspore/lite/tools/benchmark/benchmark.cc
浏览文件 @
09142f60
...
...
@@ -24,6 +24,7 @@
#include "include/ms_tensor.h"
#include "include/context.h"
#include "src/runtime/runtime_api.h"
#include "include/version.h"
namespace
mindspore
{
namespace
lite
{
...
...
@@ -352,6 +353,10 @@ int Benchmark::RunBenchmark(const std::string &deviceType) {
return
RET_ERROR
;
}
auto
model
=
lite
::
Model
::
Import
(
graphBuf
,
size
);
auto
model_version
=
model
->
GetMetaGraph
()
->
version
()
->
str
();
if
(
model_version
!=
Version
())
{
MS_LOG
(
WARNING
)
<<
"model version is "
<<
model_version
<<
", inference version is "
<<
Version
()
<<
" not equal"
;
}
if
(
model
==
nullptr
)
{
MS_LOG
(
ERROR
)
<<
"Import model file failed while running "
<<
modelName
.
c_str
();
std
::
cerr
<<
"Import model file failed while running "
<<
modelName
.
c_str
()
<<
std
::
endl
;
...
...
mindspore/lite/tools/converter/converter.cc
浏览文件 @
09142f60
...
...
@@ -33,6 +33,7 @@
#include "tools/converter/parser/onnx/onnx.pb.h"
#include "tools/converter/quantizer/post_training_quantizer.h"
#include "tools/converter/quantizer/quant_cast.h"
#include "include/version.h"
namespace
mindspore
{
namespace
lite
{
...
...
@@ -154,6 +155,7 @@ int RunConverter(int argc, const char **argv) {
// save graph to file
Storage
storage
;
fb_graph
->
version
=
Version
();
status
=
storage
.
Save
(
*
fb_graph
,
flags
->
outputFile
);
if
(
status
!=
0
)
{
MS_LOG
(
ERROR
)
<<
"Save graph failed"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录