Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OAID
Tengine
提交
33f29a22
T
Tengine
项目概览
OAID
/
Tengine
8 个月 前同步成功
通知
53
Star
4429
Fork
1032
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Tengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
33f29a22
编写于
2月 14, 2022
作者:
萝
萝卜菜
提交者:
GitHub
2月 14, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix pytengine example error (#1279)
* apply code-format changes * fix python example error
上级
159411b6
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
6 addition
and
6 deletion
+6
-6
examples/classification.py
examples/classification.py
+1
-0
examples/landmark.py
examples/landmark.py
+1
-0
examples/mobilenet_ssd.py
examples/mobilenet_ssd.py
+1
-0
examples/retinaface.py
examples/retinaface.py
+1
-1
tools/convert_tool/onnx/onnx2tengine.cpp
tools/convert_tool/onnx/onnx2tengine.cpp
+1
-3
tools/save_graph/tm2_op_save.cpp
tools/save_graph/tm2_op_save.cpp
+1
-2
未找到文件。
examples/classification.py
浏览文件 @
33f29a22
...
...
@@ -50,6 +50,7 @@ def main(args):
data
=
((
data
-
img_mean
)
*
scale
).
astype
(
np
.
float32
)
data
=
np
.
ascontiguousarray
(
data
.
transpose
((
2
,
0
,
1
)))
assert
data
.
dtype
==
np
.
float32
data
=
data
.
copy
()
graph
=
tg
.
Graph
(
None
,
'tengine'
,
tm_file
)
input_tensor
=
graph
.
getInputTensor
(
0
,
0
)
...
...
examples/landmark.py
浏览文件 @
33f29a22
...
...
@@ -60,6 +60,7 @@ def main(args):
data
=
((
data
-
img_mean
)
*
scale
[
0
]).
astype
(
np
.
float32
)
data
=
data
.
transpose
((
2
,
0
,
1
))
assert
data
.
dtype
==
np
.
float32
data
=
data
.
copy
()
graph
=
tg
.
Graph
(
None
,
'tengine'
,
tm_file
)
input_tensor
=
graph
.
getInputTensor
(
0
,
0
)
...
...
examples/mobilenet_ssd.py
浏览文件 @
33f29a22
...
...
@@ -63,6 +63,7 @@ def main(args):
data
=
((
data
-
img_mean
)
*
DEFAULT_SCALE
).
astype
(
np
.
float32
)
data
=
data
.
transpose
((
2
,
0
,
1
))
assert
data
.
dtype
==
np
.
float32
data
=
data
.
copy
()
graph
=
tg
.
Graph
(
None
,
'tengine'
,
tm_file
)
input_tensor
=
graph
.
getInputTensor
(
0
,
0
)
...
...
examples/retinaface.py
浏览文件 @
33f29a22
...
...
@@ -322,7 +322,7 @@ def main(args):
#image_data = image_data.transpose((2, 0, 1)).astype(np.float32)
image_data
=
np
.
ascontiguousarray
(
image_data
.
transpose
((
2
,
0
,
1
)).
astype
(
np
.
float32
))
image_data
=
image_data
.
copy
()
#print("img_h, img_w, img_c: %d, %d, %d" %(img_h, img_w, img_c))
input_tensor
=
graph
.
getTensorByName
(
input_name
)
...
...
tools/convert_tool/onnx/onnx2tengine.cpp
浏览文件 @
33f29a22
...
...
@@ -2132,9 +2132,7 @@ static int load_resize(ir_graph_t* graph, ir_node_t* node, const onnx::NodeProto
interp_param
->
width_scale
=
0
;
std
::
string
coordinate_transformation_mode
=
GetAttributeOrDefault
<
std
::
string
>
(
onnx_node
,
"coordinate_transformation_mode"
,
"half_pixel"
);
TASSERT
(
coordinate_transformation_mode
==
"half_pixel"
||
coordinate_transformation_mode
==
"align_corners"
||
coordinate_transformation_mode
==
"asymmetric"
);
TASSERT
(
coordinate_transformation_mode
==
"half_pixel"
||
coordinate_transformation_mode
==
"align_corners"
||
coordinate_transformation_mode
==
"asymmetric"
);
int
align_corner
=
(
coordinate_transformation_mode
==
"align_corners"
);
if
(
onnx_node
.
input_size
()
==
1
)
...
...
tools/save_graph/tm2_op_save.cpp
浏览文件 @
33f29a22
...
...
@@ -749,7 +749,6 @@ tm_uoffset_t SaveTmMinimumOp(void* const start_ptr, tm_uoffset_t* cur_pos, ir_no
return
WriteTmObject
(
start_ptr
,
cur_pos
,
&
tm_op
,
sizeof
(
TM2_Operator
));
}
tm_uoffset_t
SaveTmSqueezeOp
(
void
*
const
start_ptr
,
tm_uoffset_t
*
cur_pos
,
ir_node_t
*
node
)
{
struct
squeeze_param
*
p
=
(
struct
squeeze_param
*
)
node
->
op
.
param_mem
;
...
...
@@ -1608,7 +1607,7 @@ op_save_t SaveTmOpFunc(uint32_t op_type)
case
OP_MINIMUM
:
return
SaveTmMinimumOp
;
default:
fprintf
(
stderr
,
"Operator #%d not supported in tengine model yet
\n
"
,
op_type
);
fprintf
(
stderr
,
"Operator #%d not supported in tengine model yet
\n
"
,
op_type
);
return
nullptr
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录