ADD_DEFINITIONS(-DGRAPH_DEBUG)
ENDIF()
+IF (${ARMNN_TFLITE_PARSER_SUPPORT})
+ MESSAGE("TFlite parser support enabled.")
+ ADD_DEFINITIONS(-DTFLITE_PARSER_SUPPORT)
+ENDIF()
+
ADD_DEFINITIONS(-DARMNN_LOG_LEVEL=${ARMNN_LOG_LEVEL})
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
# Log levels of ARMNN_LOG
# Trace = 0, Debug = 1, Info = 2, Warning = 3, Error = 4, Fatal = 5
-%define build_options -DARMNN_GRAPH_DEBUG=0 -DARMNN_LOG_LEVEL=2
+%define build_options -DARMNN_GRAPH_DEBUG=0 -DARMNN_LOG_LEVEL=2 -DARMNN_TFLITE_PARSER_SUPPORT=0
%description
ARM Neural Network Runtime based implementation of inference-engine-interface
#include <armnn/ArmNN.hpp>
#include <armnn/backends/ITensorHandle.hpp>
+
+#if TFLITE_PARSER_SUPPORT
#include <armnnTfLiteParser/ITfLiteParser.hpp>
+#endif
#define LOG_LEVEL ARMNN_LOG_LEVEL
return INFERENCE_ENGINE_ERROR_NONE;
}
+#if TFLITE_PARSER_SUPPORT
int InferenceARMNN::CreateTfLiteNetwork(std::string model_path)
{
LOGI("ENTER");
return INFERENCE_ENGINE_ERROR_NONE;
}
+#endif // TFLITE_PARSER_SUPPORT
int InferenceARMNN::CreateNetwork(std::vector<std::string> model_paths,
inference_model_format_e model_format)
int ret = INFERENCE_ENGINE_ERROR_NONE;
switch ((int) model_format) {
- case INFERENCE_MODEL_CAFFE:
- case INFERENCE_MODEL_TF:
- case INFERENCE_MODEL_ONNX:
- ret = INFERENCE_ENGINE_ERROR_NOT_SUPPORTED_FORMAT;
- // TODO. Call a proper parser.
- break;
case INFERENCE_MODEL_TFLITE:
+#if TFLITE_PARSER_SUPPORT
std::string model_path = model_paths[0];
if (access(model_path.c_str(), F_OK)) {
LOGE("modelFilePath in [%s] ", model_path.c_str());
LOGI("It will try to load %s model file", model_path.c_str());
return CreateTfLiteNetwork(model_path);
+#endif
+ case INFERENCE_MODEL_CAFFE:
+ case INFERENCE_MODEL_TF:
+ case INFERENCE_MODEL_ONNX:
+ ret = INFERENCE_ENGINE_ERROR_NOT_SUPPORTED_FORMAT;
+ // TODO. Call a proper parser.
+ break;
+ default:
+ LOGE("Model format %d not supported.", static_cast<int>(model_format));
+ ret = INFERENCE_ENGINE_ERROR_NOT_SUPPORTED_FORMAT;
+ break;
}
LOGE("Model format not supported.");