提交 59fd4c58 编写于 作者: H hjchen2

Revert googlenet test cpp

上级 5492eff7
...@@ -26,7 +26,7 @@ int main() { ...@@ -26,7 +26,7 @@ int main() {
#endif #endif
paddle_mobile.SetThreadNum(1); paddle_mobile.SetThreadNum(1);
bool optimize = false; bool optimize = true;
auto time1 = time(); auto time1 = time();
if (paddle_mobile.Load(g_googlenet, optimize)) { if (paddle_mobile.Load(g_googlenet, optimize)) {
auto time2 = time(); auto time2 = time();
...@@ -35,10 +35,10 @@ int main() { ...@@ -35,10 +35,10 @@ int main() {
std::vector<float> output; std::vector<float> output;
std::vector<int64_t> dims{1, 3, 224, 224}; std::vector<int64_t> dims{1, 3, 224, 224};
GetInput<float>(g_test_image_1x3x224x224, &input, dims); GetInput<float>(g_test_image_1x3x224x224, &input, dims);
// // 预热十次 // 预热十次
// for (int i = 0; i < 10; ++i) { for (int i = 0; i < 10; ++i) {
// output = paddle_mobile.Predict(input, dims); output = paddle_mobile.Predict(input, dims);
// } }
auto time3 = time(); auto time3 = time();
for (int i = 0; i < 10; ++i) { for (int i = 0; i < 10; ++i) {
output = paddle_mobile.Predict(input, dims); output = paddle_mobile.Predict(input, dims);
...@@ -47,9 +47,6 @@ int main() { ...@@ -47,9 +47,6 @@ int main() {
std::cout << "predict cost :" << time_diff(time3, time4) / 10 << "ms" std::cout << "predict cost :" << time_diff(time3, time4) / 10 << "ms"
<< std::endl; << std::endl;
for (int i = 0; i < output.size(); ++i) {
DLOG << "result[" << i << "] = " << output[i];
}
} }
return 0; return 0;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册