diff options
author | Derek Lamberti <derek.lamberti@arm.com> | 2019-11-26 16:38:31 +0000 |
---|---|---|
committer | Derek Lamberti <derek.lamberti@arm.com> | 2019-12-05 15:35:51 +0000 |
commit | 08446976e3b6ce0e02f22b391b37aacaad181e1a (patch) | |
tree | b57106c6a3e28662adb2592ac3e850a8f19b6ec7 /tests/InferenceTest.inl | |
parent | a3b31f010004ed397ec04325edf7020984847f21 (diff) | |
download | armnn-08446976e3b6ce0e02f22b391b37aacaad181e1a.tar.gz |
Replace boost logging with simple logger
!referencetests:214319
* Reduces arm nn binary size ~15%
* Also fixed test logging black hole issues
Change-Id: Iba27db304d9a8088fa46aeb0b52225d93bb56bc8
Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
Diffstat (limited to 'tests/InferenceTest.inl')
-rw-r--r-- | tests/InferenceTest.inl | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tests/InferenceTest.inl b/tests/InferenceTest.inl index c91193f187..fd888e2137 100644 --- a/tests/InferenceTest.inl +++ b/tests/InferenceTest.inl @@ -6,7 +6,6 @@ #include <boost/algorithm/string.hpp> #include <boost/numeric/conversion/cast.hpp> -#include <boost/log/trivial.hpp> #include <boost/filesystem/path.hpp> #include <boost/assert.hpp> #include <boost/format.hpp> @@ -121,11 +120,11 @@ TestCaseResult ClassifierTestCase<TTestCaseDatabase, TModel>::ProcessResult(cons ClassifierResultProcessor resultProcessor(m_QuantizationParams.first, m_QuantizationParams.second); boost::apply_visitor(resultProcessor, output); - BOOST_LOG_TRIVIAL(info) << "= Prediction values for test #" << testCaseId; + ARMNN_LOG(info) << "= Prediction values for test #" << testCaseId; auto it = resultProcessor.GetResultMap().rbegin(); for (int i=0; i<5 && it != resultProcessor.GetResultMap().rend(); ++i) { - BOOST_LOG_TRIVIAL(info) << "Top(" << (i+1) << ") prediction is " << it->second << + ARMNN_LOG(info) << "Top(" << (i+1) << ") prediction is " << it->second << " with value: " << (it->first); ++it; } @@ -141,7 +140,7 @@ TestCaseResult ClassifierTestCase<TTestCaseDatabase, TModel>::ProcessResult(cons // If we're just running the defaultTestCaseIds, each one must be classified correctly. if (params.m_IterationCount == 0 && prediction != m_Label) { - BOOST_LOG_TRIVIAL(error) << "Prediction for test case " << testCaseId << " (" << prediction << ")" << + ARMNN_LOG(error) << "Prediction for test case " << testCaseId << " (" << prediction << ")" << " is incorrect (should be " << m_Label << ")"; return TestCaseResult::Failed; } @@ -149,7 +148,7 @@ TestCaseResult ClassifierTestCase<TTestCaseDatabase, TModel>::ProcessResult(cons // If a validation file was provided as input, it checks that the prediction matches. if (!m_ValidationPredictions.empty() && prediction != m_ValidationPredictions[testCaseId]) { - BOOST_LOG_TRIVIAL(error) << "Prediction for test case " << testCaseId << " (" << prediction << ")" << + ARMNN_LOG(error) << "Prediction for test case " << testCaseId << " (" << prediction << ")" << " doesn't match the prediction in the validation file (" << m_ValidationPredictions[testCaseId] << ")"; return TestCaseResult::Failed; } @@ -250,7 +249,7 @@ bool ClassifierTestCaseProvider<TDatabase, InferenceModel>::OnInferenceTestFinis { const double accuracy = boost::numeric_cast<double>(m_NumCorrectInferences) / boost::numeric_cast<double>(m_NumInferences); - BOOST_LOG_TRIVIAL(info) << std::fixed << std::setprecision(3) << "Overall accuracy: " << accuracy; + ARMNN_LOG(info) << std::fixed << std::setprecision(3) << "Overall accuracy: " << accuracy; // If a validation file was requested as output, the predictions are saved to it. if (!m_ValidationFileOut.empty()) @@ -265,7 +264,7 @@ bool ClassifierTestCaseProvider<TDatabase, InferenceModel>::OnInferenceTestFinis } else { - BOOST_LOG_TRIVIAL(error) << "Failed to open output validation file: " << m_ValidationFileOut; + ARMNN_LOG(error) << "Failed to open output validation file: " << m_ValidationFileOut; return false; } } @@ -310,7 +309,6 @@ int InferenceTestMain(int argc, armnn::LogSeverity level = armnn::LogSeverity::Debug; #endif armnn::ConfigureLogging(true, true, level); - armnnUtils::ConfigureLogging(boost::log::core::get().get(), true, true, level); try { @@ -331,7 +329,7 @@ int InferenceTestMain(int argc, } catch (armnn::Exception const& e) { - BOOST_LOG_TRIVIAL(fatal) << "Armnn Error: " << e.what(); + ARMNN_LOG(fatal) << "Armnn Error: " << e.what(); return 1; } } |