blob: e6e9a754f60177aa230a88de57a5ffd621f15fd5 [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"
telsoa01c577f2c2018-08-31 09:22:23 +01006#include "../CaffePreprocessor.hpp"
telsoa014fcda012018-03-09 14:13:49 +00007#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 = CaffePreprocessor;
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, "bvlc_alexnet_1.caffemodel", true, "data", "prob", { 0 },
telsoa01c577f2c2018-08-31 09:22:23 +010022 [](const char* dataDir, const ModelType &) {
23 return DatabaseType(dataDir);
24 });
surmeh013537c2c2018-05-18 16:31:43 +010025 }
26 catch (const std::exception& e)
27 {
28 // Coverity fix: BOOST_LOG_TRIVIAL (typically used to report errors) may throw an
29 // exception of type std::length_error.
30 // Using stderr instead in this context as there is no point in nesting try-catch blocks here.
31 std::cerr << "WARNING: CaffeAlexNet-Armnn: An error has occurred when running the "
32 "classifier inference tests: " << e.what() << std::endl;
33 }
34 return retVal;
telsoa014fcda012018-03-09 14:13:49 +000035}