blob: d2b4ade1e03addfb4abc50ea41970e23aed0c043 [file] [log] [blame]
telsoa014fcda012018-03-09 14:13:49 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
telsoa014fcda012018-03-09 14:13:49 +00004//
5#include "../InferenceTest.hpp"
6#include "../Cifar10Database.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 = Cifar10Database;
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, "cifar10_full_iter_60000.caffemodel", true, "data", "prob",
22 { 0, 1, 2, 4, 7 },
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: CaffeCifar10AcrossChannels-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}