# TensorFlow Conversion Custom Layers Possible?

**URL:** <https://forums.developer.nvidia.com/t/tensorflow-conversion-custom-layers-possible/56947>\
**Category:** GPU-Accelerated Libraries\
**Created:** [January 11, 2018, 2:09am UTC](https://forums.developer.nvidia.com/t/tensorflow-conversion-custom-layers-possible/56947 "2018-01-11T02:09:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomas.deegan](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@thomas.deegan](https://forums.developer.nvidia.com/u/thomas.deegan)\
**Post date:** [January 11, 2018, 2:09am UTC](https://forums.developer.nvidia.com/t/tensorflow-conversion-custom-layers-possible/56947/1 "2018-01-11T02:09:54Z")

</div>

Hi. I am converting my tensorflow model over to TensorRT with the UFF tool.

I successful generate a UFF file albeit with some expected warnings that layers are unsupported:

```auto
Warning: No conversion function registered for layer: AddN yet.
Converting as custom op AddN l_4/AddN
name: "l_4/AddN"
op: "AddN"
input: "l_4/Conv/Elu"
input: "l_4/Conv_7/Elu"
attr {
  key: "N"
  value {
    i: 2
  }
}
attr {
  key: "T"
  value {
    type: DT_FLOAT
  }
}

```

When I try to load the UFF file into the UFF parser though it crashes saying unsupported layer!

```auto
[ERROR] UFFParser: Validator error: l_15/AddN: Unsupported operation _AddN
ASSERT(parser->parse(uffFile.c_str(), network, nvinfer::DataType::kFLOAT)) failed at ros/src/tensorrt/EngineBuilder.cpp:118
Backtrace: 
main in ??:0
__libc_start_main in /build/eglibc-SvCtMH/eglibc-2.19/csu/libc-start.c:321
_start in ??:0

```

The caffe parser has a “setPluginFactory” method which is called when an unrecognized layer exists however there seems to be no such option with the UFF parser. Is there another way to provide plugins for UFF/TensorFlow? This would be greatly disappointing if there was no way to use plugins in conjunction with Tensorflow.

```auto
class ICaffeParser
{
public:
 virtual void setPluginFactory(IPluginFactory* factory)
};

```

---

<div class="post-metadata">

**Author:** ![thomas.deegan](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@thomas.deegan](https://forums.developer.nvidia.com/u/thomas.deegan)\
**Post date:** [January 11, 2018, 7:48am UTC](https://forums.developer.nvidia.com/t/tensorflow-conversion-custom-layers-possible/56947/2 "2018-01-11T07:48:54Z")

</div>

Apparently not supported “yet” [TensorRT and Tensorflow: convert to uff failed - Jetson TX2 - NVIDIA Developer Forums](https://devtalk.nvidia.com/default/topic/1025899/?comment=5227975)
