ArmNN
 20.02
TfCifar10-Armnn.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #include "../InferenceTest.hpp"
6 #include "../Cifar10Database.hpp"
8 
9 int main(int argc, char* argv[])
10 {
11  armnn::TensorShape inputTensorShape({ 1, 32, 32, 3 });
12 
13  int retVal = EXIT_FAILURE;
14  try
15  {
16  using DataType = float;
17  using DatabaseType = Cifar10Database;
18  using ParserType = armnnTfParser::ITfParser;
19  using ModelType = InferenceModel<ParserType, DataType>;
20 
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);
28  }
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;
38 }
int main(int argc, char *argv[])
DataType
Definition: Types.hpp:32
Parses a directed acyclic graph from a tensorflow protobuf file.
Definition: ITfParser.hpp:25