2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
5 #include "../InferenceTest.hpp"
6 #include "../Cifar10Database.hpp"
7 #include "armnnTfParser/ITfParser.hpp"
9 int main(int argc, char* argv[])
11 armnn::TensorShape inputTensorShape({ 1, 32, 32, 3 });
13 int retVal = EXIT_FAILURE;
16 using DataType = float;
17 using DatabaseType = Cifar10Database;
18 using ParserType = armnnTfParser::ITfParser;
19 using ModelType = InferenceModel<ParserType, DataType>;
21 // Coverity fix: ClassifierInferenceTestMain() may throw uncaught exceptions.
22 retVal = armnn::test::ClassifierInferenceTestMain<DatabaseType, ParserType>(
23 argc, argv, "cifar10_tf.prototxt", false,
24 "data", "prob", { 0, 1, 2, 4, 7 },
25 [](const char* dataDir, const ModelType&) {
26 return DatabaseType(dataDir, true);
27 }, &inputTensorShape);
29 catch (const std::exception& e)
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;