blob: d42dd2d804432feef2486c6e69fef7612c74241a [file] [log] [blame]
surmeh01bceff2f2018-03-29 16:29:27 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
surmeh01bceff2f2018-03-29 16:29:27 +01004//
5#include "../InferenceTest.hpp"
6#include "../Cifar10Database.hpp"
7#include "armnnTfParser/ITfParser.hpp"
8
9int main(int argc, char* argv[])
10{
11 armnn::TensorShape inputTensorShape({ 1, 32, 32, 3 });
surmeh013537c2c2018-05-18 16:31:43 +010012
13 int retVal = EXIT_FAILURE;
14 try
15 {
telsoa01c577f2c2018-08-31 09:22:23 +010016 using DataType = float;
17 using DatabaseType = Cifar10Database;
18 using ParserType = armnnTfParser::ITfParser;
19 using ModelType = InferenceModel<ParserType, DataType>;
20
surmeh013537c2c2018-05-18 16:31:43 +010021 // Coverity fix: ClassifierInferenceTestMain() may throw uncaught exceptions.
telsoa01c577f2c2018-08-31 09:22:23 +010022 retVal = armnn::test::ClassifierInferenceTestMain<DatabaseType, ParserType>(
surmeh013537c2c2018-05-18 16:31:43 +010023 argc, argv, "cifar10_tf.prototxt", false,
24 "data", "prob", { 0, 1, 2, 4, 7 },
telsoa01c577f2c2018-08-31 09:22:23 +010025 [](const char* dataDir, const ModelType&) {
26 return DatabaseType(dataDir, true);
27 }, &inputTensorShape);
surmeh013537c2c2018-05-18 16:31:43 +010028 }
29 catch (const std::exception& e)
30 {
31 // Coverity fix: BOOST_LOG_TRIVIAL (typically used to report errors) may throw an
32 // exception of type std::length_error.
33 // Using stderr instead in this context as there is no point in nesting try-catch blocks here.
34 std::cerr << "WARNING: TfCifar10-Armnn: An error has occurred when running "
35 "the classifier inference tests: " << e.what() << std::endl;
36 }
37 return retVal;
surmeh01bceff2f2018-03-29 16:29:27 +010038}