2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // See LICENSE file in the project root for full license information.
5 #include "../InferenceTest.hpp"
6 #include "../CaffePreprocessor.hpp"
7 #include "armnnCaffeParser/ICaffeParser.hpp"
9 int main(int argc, char* argv[])
11 int retVal = EXIT_FAILURE;
14 // Coverity fix: The following code may throw an exception of type std::length_error.
15 std::vector<ImageSet> imageSet =
20 using DataType = float;
21 using DatabaseType = CaffePreprocessor;
22 using ParserType = armnnCaffeParser::ICaffeParser;
23 using ModelType = InferenceModel<ParserType, DataType>;
25 // Coverity fix: ClassifierInferenceTestMain() may throw uncaught exceptions.
26 retVal = armnn::test::ClassifierInferenceTestMain<DatabaseType, ParserType>(
27 argc, argv, "Inception-BN-batchsize1.caffemodel", true,
28 "data", "softmax", { 0 },
29 [&imageSet](const char* dataDir, const ModelType&) {
30 return DatabaseType(dataDir, 224, 224, imageSet);
33 catch (const std::exception& e)
35 // Coverity fix: BOOST_LOG_TRIVIAL (typically used to report errors) may throw an
36 // exception of type std::length_error.
37 // Using stderr instead in this context as there is no point in nesting try-catch blocks here.
38 std::cerr << "WARNING: CaffeInception_BN-Armnn: An error has occurred when running "
39 "the classifier inference tests: " << e.what() << std::endl;