2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
5 #include "../InferenceTest.hpp"
6 #include "../MnistDatabase.hpp"
7 #include "armnnCaffeParser/ICaffeParser.hpp"
9 int main(int argc, char* argv[])
11 int retVal = EXIT_FAILURE;
14 using DataType = float;
15 using DatabaseType = MnistDatabase;
16 using ParserType = armnnCaffeParser::ICaffeParser;
17 using ModelType = InferenceModel<ParserType, DataType>;
19 // Coverity fix: ClassifierInferenceTestMain() may throw uncaught exceptions.
20 retVal = armnn::test::ClassifierInferenceTestMain<DatabaseType, ParserType>(
21 argc, argv, "lenet_iter_9000.caffemodel", true, "data", "prob",
23 [](const char* dataDir, const ModelType&) {
24 return DatabaseType(dataDir);
27 catch (const std::exception& e)
29 // Coverity fix: BOOST_LOG_TRIVIAL (typically used to report errors) may throw an
30 // exception of type std::length_error.
31 // Using stderr instead in this context as there is no point in nesting try-catch blocks here.
32 std::cerr << "WARNING: CaffeMnist-Armnn: An error has occurred when running "
33 "the classifier inference tests: " << e.what() << std::endl;