From 59fd4c586c261b36970e93a74f0d11343393ab7e Mon Sep 17 00:00:00 2001 From: hjchen2 Date: Thu, 25 Oct 2018 08:03:30 +0000 Subject: [PATCH] Revert googlenet test cpp --- test/net/test_googlenet.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/test/net/test_googlenet.cpp b/test/net/test_googlenet.cpp index c88a78974c..b489f33bab 100644 --- a/test/net/test_googlenet.cpp +++ b/test/net/test_googlenet.cpp @@ -26,7 +26,7 @@ int main() { #endif paddle_mobile.SetThreadNum(1); - bool optimize = false; + bool optimize = true; auto time1 = time(); if (paddle_mobile.Load(g_googlenet, optimize)) { auto time2 = time(); @@ -35,10 +35,10 @@ int main() { std::vector output; std::vector dims{1, 3, 224, 224}; GetInput(g_test_image_1x3x224x224, &input, dims); - // // 预热十次 - // for (int i = 0; i < 10; ++i) { - // output = paddle_mobile.Predict(input, dims); - // } + // 预热十次 + for (int i = 0; i < 10; ++i) { + output = paddle_mobile.Predict(input, dims); + } auto time3 = time(); for (int i = 0; i < 10; ++i) { output = paddle_mobile.Predict(input, dims); @@ -47,9 +47,6 @@ int main() { std::cout << "predict cost :" << time_diff(time3, time4) / 10 << "ms" << std::endl; - for (int i = 0; i < output.size(); ++i) { - DLOG << "result[" << i << "] = " << output[i]; - } } return 0; } -- GitLab