blob: 644041bb5f98ff601bb989a889b4faa89f93279b [file] [log] [blame]
telsoa014fcda012018-03-09 14:13:49 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// See LICENSE file in the project root for full license information.
4//
5#include "../InferenceTest.hpp"
6#include "../MnistDatabase.hpp"
7#include "armnnCaffeParser/ICaffeParser.hpp"
8
9int main(int argc, char* argv[])
10{
surmeh013537c2c2018-05-18 16:31:43 +010011 int retVal = EXIT_FAILURE;
12 try
13 {
telsoa01c577f2c2018-08-31 09:22:23 +010014 using DataType = float;
15 using DatabaseType = MnistDatabase;
16 using ParserType = armnnCaffeParser::ICaffeParser;
17 using ModelType = InferenceModel<ParserType, DataType>;
18
surmeh013537c2c2018-05-18 16:31:43 +010019 // Coverity fix: ClassifierInferenceTestMain() may throw uncaught exceptions.
telsoa01c577f2c2018-08-31 09:22:23 +010020 retVal = armnn::test::ClassifierInferenceTestMain<DatabaseType, ParserType>(
surmeh013537c2c2018-05-18 16:31:43 +010021 argc, argv, "lenet_iter_9000.caffemodel", true, "data", "prob",
22 { 0, 1, 5, 8, 9 },
telsoa01c577f2c2018-08-31 09:22:23 +010023 [](const char* dataDir, const ModelType&) {
24 return DatabaseType(dataDir);
25 });
surmeh013537c2c2018-05-18 16:31:43 +010026 }
27 catch (const std::exception& e)
28 {
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;
34 }
35 return retVal;
telsoa014fcda012018-03-09 14:13:49 +000036}