Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
66418575
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
332
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
66418575
编写于
12月 03, 2018
作者:
Z
zhangyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rm tensor dump for FPGA track
上级
6b14134f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
13 deletion
+18
-13
test/fpga/test_resnet50.cpp
test/fpga/test_resnet50.cpp
+18
-13
未找到文件。
test/fpga/test_resnet50.cpp
浏览文件 @
66418575
...
...
@@ -12,6 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#include <fstream>
#include <iomanip>
#include <iostream>
#include "../test_include.h"
#ifdef PADDLE_MOBILE_FPGA_V1
...
...
@@ -87,26 +89,29 @@ int main() {
paddle_mobile
::
PaddleMobile
<
paddle_mobile
::
FPGA
>
paddle_mobile
;
if
(
paddle_mobile
.
Load
(
std
::
string
(
g_resnet50
),
true
))
{
Tensor
input_tensor
;
SetupTensor
<
float
>
(
&
input_tensor
,
{
1
,
3
,
224
,
224
},
static_cast
<
float
>
(
0
),
static_cast
<
float
>
(
1
));
SetupTensor
<
float
>
(
&
input_tensor
,
{
1
,
3
,
224
,
224
},
static_cast
<
float
>
(
2
),
static_cast
<
float
>
(
2
));
readStream
(
g_image_src_float
,
input_tensor
.
mutable_data
<
float
>
({
1
,
3
,
224
,
224
}));
paddle_mobile
.
FeedData
(
input_tensor
);
paddle_mobile
.
Predict_To
(
-
1
);
/*for(int i = 0; i < 73; i++)
{
for
(
int
i
=
0
;
i
<
73
;
i
++
)
{
auto
tensor_ptr
=
paddle_mobile
.
FetchResult
(
i
);
std::string saveName = "resnet50_result_" + std::to_string
(i);
std
::
string
saveName
=
"resnet50_result_"
+
std
::
to_string
(
i
);
paddle_mobile
::
fpga
::
fpga_invalidate
((
*
tensor_ptr
).
data
<
float
>
(),
tensor_ptr->numel()); dump_stride(saveName, (*tensor_ptr), 20);
//dump(saveName, (*tensor_ptr));
}*/
tensor_ptr
->
numel
()
*
sizeof
(
half
));
dump_stride
(
saveName
,
(
*
tensor_ptr
),
20
);
// dump(saveName, (*tensor_ptr));
}
/*
std::shared_ptr<Tensor> output_tensor = paddle_mobile.FetchResult(73);
(*output_tensor).dump<float>("resnet50_result_73");
std
::
shared_ptr
<
Tensor
>
output_tensor
=
paddle_mobile
.
FetchResult
(
73
);
//
(*output_tensor).dump<float>("resnet50_result_73");
output_tensor
=
paddle_mobile
.
FetchResult
(
74
);
(*output_tensor).dump<float>("resnet50_result_74");*/
std
::
shared_ptr
<
Tensor
>
output_tensor
=
paddle_mobile
.
FetchResult
(
74
);
//(*output_tensor).dump<float>("resnet50_result_74");
// std::shared_ptr<Tensor> output_tensor = paddle_mobile.FetchResult(74);
// output_tensor = paddle_mobile.FetchResult(74);
float
max
=
0
;
auto
data_ptr
=
output_tensor
->
data
<
float
>
();
int
maximumIdx
=
0
;
...
...
@@ -116,7 +121,7 @@ int main() {
max
=
data_ptr
[
i
];
}
}
std
::
cout
<<
"index : "
<<
maximumIdx
<<
", value : "
<<
max
std
::
cout
<<
"index : "
<<
std
::
dec
<<
maximumIdx
<<
", value : "
<<
max
<<
std
::
endl
;
std
::
cout
<<
"Computation done"
<<
std
::
endl
;
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录