Question: I recently trained an object detection model on Google's Vision platform and exported it to a TensorFlow Lite edge model.

I receive this error in Xcode when running on an iOS device with a CoreML delegate:

> 
> validator error: Padding type for the pooling layer 'PoolingLayerBuilder (MEAN)\_1' is not set.
> 
> 
> 

When running on iOS using TensorFlow lite with a CoreML delegate I get this error:

> 
> Error compiling model Error reading protobuf spec. validator error: Padding type for the pooling layer 'PoolingLayerBuilder (MEAN)\_1' is not set.
> 
> 
> 

Here's what I've tried so far:

* Updating my pods to make sure I'm on the TensorFlowLiteSwift nightly build
* Running on CPU only (the model works, so I know its a CoreML delegate problem)
* Making sure CoreMLDelegate is using the latest version of CoreML (3)

**Next Steps?**

* Try to modify the TFLite file itself to set the padding type for the pooling layer somehow. It's not obvious how to do this
* Try to modify the CoreML delegate to set the padding type to a default? Somewhere in this file? <https://github.com/tensorflow/tensorflow/blob/nightly/tensorflow/lite/delegates/coreml/builders/pooling_layer_builder.cc#L54>

Is that the right approach or is there an easier solution I'm not seeing?

Answer: 
If you specify `include_directories()` directly you don't need to use the relative paths in your source files:

```
#include "include/utilities.hpp"

```

Instead use:

```
#include "utilities.hpp"

```

If you instead want to keep the relative paths then you need to remove the `include_directories()` from the `CMakeLists.txt`.

The `include_directories()` tells the compiler where it should search for includes.
I solved the problem by changing the contents of CMakeLists.txt to:

```
cmake_minimum_required(VERSION 3.16.3)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(search VERSION 1.0.0)
set(WORKING_DIRECTORY /home/mohammed/Work/Projects/search)

add_executable(
    search
    ${WORKING_DIRECTORY}/source/utilities.cpp
    ${WORKING_DIRECTORY}/source/main.cpp
    ${WORKING_DIRECTORY}/include/utilities.hpp
)

include_directories(${WORKING_DIRECTORY})

```

A huge thanks to [RoQuOTrix](https://stackoverflow.com/users/8473031/roquotrix).