diff --git a/test/net/test_googlenet.cpp b/test/net/test_googlenet.cpp index 96d9479eab07a4beb1631949e822529640e99d87..a2f030eeac5c2584b33fad2b082b9d5513707260 100644 --- a/test/net/test_googlenet.cpp +++ b/test/net/test_googlenet.cpp @@ -34,7 +34,7 @@ int main() { std::vector input; std::vector dims{1, 3, 224, 224}; GetInput(g_test_image_1x3x224x224, &input, dims); - // 预热一次 + // 预热十次 for (int i = 0; i < 10; ++i) { auto vec_result = paddle_mobile.Predict(input, dims); } diff --git a/test/net/test_mobilenet+ssd.cpp b/test/net/test_mobilenet+ssd.cpp index 0bb6fea0e7bb5bd8d3154bd1a6ea21e42582aaa4..85083ca441ad242ffb5b63dd612a0e35e3589f99 100644 --- a/test/net/test_mobilenet+ssd.cpp +++ b/test/net/test_mobilenet+ssd.cpp @@ -32,7 +32,7 @@ int main() { std::vector dims{1, 3, 300, 300}; GetInput(g_hand, &input, dims); - // 预热一次 + // 预热十次 for (int i = 0; i < 10; ++i) { auto output = paddle_mobile.Predict(input, dims); } diff --git a/test/net/test_mobilenet.cpp b/test/net/test_mobilenet.cpp index fe7b431caf07ae260e60dbe2fdc8765eecd43f2f..4ed7d3b756cfef9554028e1d33f4dd86bf58e4b8 100644 --- a/test/net/test_mobilenet.cpp +++ b/test/net/test_mobilenet.cpp @@ -32,13 +32,13 @@ int main() { std::vector dims{1, 3, 224, 224}; GetInput(g_test_image_1x3x224x224_banana, &input, dims); - // 预热一次 auto vec_result = paddle_mobile.Predict(input, dims); std::vector::iterator biggest = std::max_element(std::begin(vec_result), std::end(vec_result)); std::cout << " Max element is " << *biggest << " at position " << std::distance(std::begin(vec_result), biggest) << std::endl; + // 预热十次 for (int i = 0; i < 10; ++i) { auto vec_result = paddle_mobile.Predict(input, dims); } diff --git a/test/net/test_mobilenet_combine.cpp b/test/net/test_mobilenet_combine.cpp index af93d105ea0c290b1dd3a80310a39e0f52c8abaa..073607795967af09c81bc0a0c492d065bce7ed72 100644 --- a/test/net/test_mobilenet_combine.cpp +++ b/test/net/test_mobilenet_combine.cpp @@ -29,13 +29,16 @@ int main() { std::vector dims{1, 3, 224, 224}; GetInput(g_test_image_1x3x224x224_banana, &input, dims); - // 预热一次 auto vec_result = paddle_mobile.Predict(input, dims); std::vector::iterator biggest = std::max_element(std::begin(vec_result), std::end(vec_result)); std::cout << " Max element is " << *biggest << " at position " << std::distance(std::begin(vec_result), biggest) << std::endl; + // 预热十次 + for (int i = 0; i < 10; ++i) { + auto vec_result = paddle_mobile.Predict(input, dims); + } auto time3 = time(); for (int i = 0; i < 10; ++i) { auto vec_result = paddle_mobile.Predict(input, dims); diff --git a/test/net/test_resnet.cpp b/test/net/test_resnet.cpp index 82fdc22763d11d4b06439465d56d0e6fa663a317..f890646466966ed56f8fad9e28c595310419ee78 100644 --- a/test/net/test_resnet.cpp +++ b/test/net/test_resnet.cpp @@ -36,8 +36,10 @@ int main() { std::vector input(input_tensor.data(), input_tensor.data() + input_tensor.numel()); - // 预热一次 - paddle_mobile.Predict(input, dims); + // 预热十次 + for (int i = 0; i < 10; ++i) { + paddle_mobile.Predict(input, dims); + } auto time3 = time(); for (int i = 0; i < 10; ++i) { paddle_mobile.Predict(input, dims); diff --git a/test/net/test_squeezenet.cpp b/test/net/test_squeezenet.cpp index 3ed0299d9df69bb9c77e078f2f42ee90f0667b1e..02ec8691febbad5ec0e811f7d7bebde1bef54a79 100644 --- a/test/net/test_squeezenet.cpp +++ b/test/net/test_squeezenet.cpp @@ -32,7 +32,7 @@ int main() { std::vector input(input_tensor.data(), input_tensor.data() + input_tensor.numel()); - // 预热一次 + // 预热十次 for (int i = 0; i < 10; ++i) { paddle_mobile.Predict(input, dims); } diff --git a/test/net/test_yolo.cpp b/test/net/test_yolo.cpp index bb566d8b8e4907f8b979222d36f421914cca50bf..700eb10cac6f0b80595d8c53866c7f675d2b56fb 100644 --- a/test/net/test_yolo.cpp +++ b/test/net/test_yolo.cpp @@ -33,7 +33,7 @@ int main() { std::vector input(input_tensor.data(), input_tensor.data() + input_tensor.numel()); - // 预热一次 + // 预热十次 for (int i = 0; i < 10; ++i) { paddle_mobile.Predict(input, dims); }