Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaomi
Mace
提交
e93296e0
Mace
项目概览
Xiaomi
/
Mace
通知
106
Star
40
Fork
27
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Mace
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e93296e0
编写于
2月 11, 2019
作者:
李
李超
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'fix-data-format-bug' into 'master'
Bug: Fix data format bug at buffer_transformer. See merge request !976
上级
df10b17f
56216c59
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
12 addition
and
14 deletion
+12
-14
mace/core/memory_optimizer.cc
mace/core/memory_optimizer.cc
+5
-1
mace/core/tensor.h
mace/core/tensor.h
+4
-3
mace/ops/opencl/buffer_transformer.h
mace/ops/opencl/buffer_transformer.h
+1
-1
mace/ops/reshape.cc
mace/ops/reshape.cc
+0
-7
mace/python/tools/converter_tool/caffe_converter.py
mace/python/tools/converter_tool/caffe_converter.py
+2
-2
未找到文件。
mace/core/memory_optimizer.cc
浏览文件 @
e93296e0
...
...
@@ -222,7 +222,11 @@ void MemoryOptimizer::Optimize(
idle_blocks_
.
insert
(
mem_id
);
}
}
else
{
MACE_CHECK
(
tensor_ref_count_
.
at
(
input_name
)
>=
0
);
MACE_CHECK
(
tensor_ref_count_
.
at
(
input_name
)
>=
0
,
"Reference count of tensor "
,
input_name
,
" is "
,
tensor_ref_count_
.
at
(
input_name
));
}
}
}
...
...
mace/core/tensor.h
浏览文件 @
e93296e0
...
...
@@ -348,9 +348,10 @@ class Tensor {
MACE_CHECK
(
image_shape
[
0
]
<=
buffer_
->
shape
()[
0
]
&&
image_shape
[
1
]
<=
buffer_
->
shape
()[
1
],
"tensor (source op "
,
name_
,
"): current physical image shape: "
,
buffer_
->
shape
()[
0
],
", "
,
buffer_
->
shape
()[
1
],
" < logical image shape: "
,
image_shape
[
0
],
", "
,
image_shape
[
1
]);
"): current logical image shape:"
,
image_shape
[
0
],
", "
,
image_shape
[
1
],
" > physical image shape: "
,
buffer_
->
shape
()[
0
],
", "
,
buffer_
->
shape
()[
1
]);
return
MaceStatus
::
MACE_SUCCESS
;
}
}
...
...
mace/ops/opencl/buffer_transformer.h
浏览文件 @
e93296e0
...
...
@@ -66,7 +66,7 @@ class OpenCLBufferTransformer {
VLOG
(
2
)
<<
"Transform CPU Buffer "
<<
input
->
name
()
<<
" to GPU Buffer "
<<
internal_tensor
->
name
()
<<
" with data type "
<<
dt
;
if
(
data_format
==
DataFormat
::
N
CHW
&&
input
->
shape
().
size
()
==
4
)
{
if
(
data_format
==
DataFormat
::
N
HWC
&&
input
->
shape
().
size
()
==
4
)
{
// 1. (NCHW -> NHWC)
std
::
vector
<
int
>
dst_dims
=
{
0
,
2
,
3
,
1
};
std
::
vector
<
index_t
>
output_shape
=
...
...
mace/ops/reshape.cc
浏览文件 @
e93296e0
...
...
@@ -77,13 +77,6 @@ class ReshapeOp : public Operation {
}
Tensor
*
output
=
this
->
Output
(
OUTPUT
);
// NCHW -> NHWC
if
(
D
==
DeviceType
::
GPU
&&
out_shape
.
size
()
==
4
)
{
std
::
vector
<
int
>
dst_dims
=
{
0
,
2
,
3
,
1
};
std
::
vector
<
index_t
>
out_shape_gpu
=
TransposeShape
<
index_t
,
index_t
>
(
out_shape
,
dst_dims
);
out_shape
=
out_shape_gpu
;
}
output
->
ReuseTensorBuffer
(
*
input
);
output
->
Reshape
(
out_shape
);
...
...
mace/python/tools/converter_tool/caffe_converter.py
浏览文件 @
e93296e0
...
...
@@ -137,7 +137,6 @@ class CaffeNet(object):
layer
.
top
[
i
]
=
new_name
self
.
_alias_op_output_name
[
old_name
]
=
new_name
self
.
_used_op_output_name
.
update
([
new_name
])
for
input_tensor
in
layer
.
bottom
:
if
input_tensor
not
in
self
.
_consumers
:
self
.
_consumers
[
input_tensor
]
=
[]
...
...
@@ -248,7 +247,8 @@ class CaffeConverter(base_converter.ConverterInterface):
for
op
in
ops
:
for
i
in
six
.
moves
.
range
(
len
(
op
.
output
)):
original_output_name
=
op
.
output
[
i
].
split
(
'#'
)[
0
]
if
original_output_name
not
in
visited
:
if
original_output_name
not
in
visited
and
\
original_output_name
not
in
self
.
_option
.
input_nodes
:
self
.
replace_input_name
(
consumers
.
get
(
op
.
output
[
i
],
[]),
op
.
output
[
i
],
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录