This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA2EVM5777: Supported Tensorflow Keras and Slim layers

Part Number: TDA2EVM5777

Hi,

I was trying to convert a U-Net from Tensorflow to TIDL format using the TIDL conversion tool. However, it seems that Deconvolution is neither supported for Tensorflow Keras nor Slim. 
Afterwards, I was looking aroung to see which layers of Tensorflow are currently supported. So far, I found this link

http://software-dl.ti.com/processor-sdk-linux/esd/docs/latest/linux/Foundational_Components_TIDL.html#neural-network-layers-supported-by-tidl

which does not state wether it's talking about Keras or Slim layers (I would assume it's Slim but am not really sure). And this link
https://e2e.ti.com/support/processors/f/791/t/735984?tisearch=e2e-sitesearch&keymatch=tensorflow

which shows an example of some Keras layers working but doesn't give info about all Keras layers supported (I assume that the same Keras layers are supported as Slim but am not really sure).

So my questions would be:
1. Can you give a summary of which TF Keras and which TF Slim layers are supported by the TIDL conversion tool including corresponding TF Version.
2. Is it true that you cannot convert any types of Autoencoder architectures trained in Tensorflow using the TIDL conversion tool without having to manually add the Deconv. layer into the conversion tool?


Best regards and thanks in advance,

Daniel

  • Hi Daniel,

    1. You can refer to "TIDeepLearningLibrary_DataSheet.pdf" in the Docs folder for the layers supported by TIDL library.Also refer to TIDL user guide section

    "3.6.5 Importing Tensorflow Models " and FAQ section for more details on Tensorflow import and version.

    2. Yes, all the layers supported by TIDL could be imported using caffe models but not with Tensorflow models, so you may have to manually add these layers in the import tool

      

    Thanks,

    Praveen

  • Hi Praveen,

    first of all, thanks for the fast reply.

    1.I already looked into both resources and didn't mention them here since they don't seem to provide the information I was looking for. 

    • TIDeepLearningLibrary_DataSheet.pdf lists many layers and says they are validated using examples in Caffe and Tensorflow. It doesn't state that only a subset has been validated in Tensorflow and esspecially not which subset. 
    • "3.6.5 Importing Tensorflow Models" says "...this covers most of the CNN layers (Convolution, Max Pooling , Average pooling, Batch norm, Fully connected layer, softmax, Relu, Relu6, concate etc.)" but doesn't explicitly state which ones are not included

    Also only the "3.6.5 Importing Tensorflow Models" talks about which exact Tensorflow library is used. It begins with comments like "TIDL supports slim based tensorflow models" and "validated two pre-trained models from tensorflow github (Slim based ...)" and ends with "Refer to below trained network on CIFAR-10 dataset (Tf.keras based)...". This leads to my question wether the same Keras as Slim layers are supported or wether there is again a discripancy. 

    Hence my question, which Keras & Slim layers are actually supported. Otherwise I have to do trial and error until I verrified all the layers that are actually working for Keras (which I am currently using).

    2. This seems a bit unpractical since over 90% of the deep learning community works with Tensorflow. Hence, most of your customers will have to do the same manual labor. Would it make sense for you to support all the Caffe layers also in Tensorflow (preferrably Keras since support for Slim will end soon)?

    If not, could you point me to a resource that describes how to manually implement them into your conversion tool?

    Thanks again for your time. I appriciate your help,

    Daniel

  • Hi Daniel,

    Agree, we should have equal support for TensorFlow operators, and this is in our roadmap. 

    Currently we are working on adding support for these below operators in the TensorFlow import and I will come back on ETA for this support.

     sTIDL_tfOpParamMap_t tidl_TfOpParamMapTable[TIDL_NUM_SUPPORTED_TF_OPERATORS] =
    {
      { "Placeholder",                     TIDL_tfMapPlaceHolderParams },//  TIDL_DataLayer,
      { "Conv2D",                          TIDL_tfMapConvParams },       //  TIDL_ConvolutionLayer ,
      { "DepthwiseConv2dNative",           TIDL_tfMapDWConvParams },     //  TIDL_ConvolutionLayer ,
      { "BiasAdd",                         TIDL_tfMapBiasAddParams },    //  TIDL_BiasLayer ,
      { "Add",                             TIDL_tfMapAddParams },        //  TIDL_EltWiseLayer ,
      { "Mul",                             TIDL_tfMapMulParams },        //  TIDL_ScaleLayer ,
      { "FusedBatchNorm",                  TIDL_tfMapFusedBnParams },    //  TIDL_BatchNormLayer ,
      { "Relu",                            TIDL_tfMapReluParams },       //  TIDL_ReLULayer ,
      { "Relu6",                           TIDL_tfMapRelu6Params },      //  TIDL_ReLULayer ,
      { "MaxPool",                         TIDL_tfMapMaxPoolParams },    //  TIDL_PoolingLayer ,
      { "AvgPool",                         TIDL_tfMapAvgPoolParams },    //  TIDL_PoolingLayer ,
      { "ConcatV2",                        TIDL_tfMapConcatV2Params },   //  TIDL_ConcatLayer ,
      { "Slice",                           TIDL_tfMapSliceParams },      //  TIDL_SliceLayer ,
      { "Reshape",                         TIDL_tfMapReshapeParams },    //  TIDL_ReshapeLayer ,
      { "Softmax",                         TIDL_tfMapSoftmaxParams },    //  TIDL_SoftMaxLayer ,
      { "Pad",                             TIDL_tfMapPadParams },        //  TIDL_PadLayer ,
      { "Mean",                            TIDL_tfMapMeanParams },       //  TIDL_PoolingLayer ,
      { "Shape",                           TIDL_tfMapShapeParams }       //  TIDL_ShapeLayer ,
    };

    Thanks,

    Praveen

      

  • Hi Daniel,

    Do you any further questions on this thread ?

    Thanks,

    Praveen

  • Hmm, yes. So the thing is that I know that you don't support all of the layers and it is good to hear that you are working on that. But how long do I actually have to wait for those layers to be supported?

    Moreover, what I asked for was information about what IS currently supported because I want to build something now. To do so, I have to know what I can currently actually use and based on that assess whether it is possible to build my application or not. Additionally, I would be really keen to know whether I can also use Keras implementations because they are way easier.

    Questions:

    1. When are you going to release support for those layers and in which Tensorflow sublibrary (e.g. Slim,Keras) will they be accessable?
    2. What are the currently supported layers and in which Tensorflow sublibrary (e.g. Slim,Keras) are they accessable?

    Thanks for your patience.

  • Hi Daniel,

    Below are the currently supported layers for Tensorflow models and they work for both slim and Keras based models.

    ConvolutionLayer,

    PoolingLayer

    ConcatLayer

    InnerProductLayer

    SoftMaxLayer

    So, by implementing these layers we validated two popular Tensorflow models (mobileNet V1 and google inceptionNet).

    Regarding the support for new layers, we haven't finalized on the release date. I will come back in a week on the release date.

    Thanks,

    Praveen

      

  • Hi Praveen,

    thanks. That is exactely the information I was looking for! The sad part is that I wanted to use Deconvolution Layers which are currently not supported...
    Hmm, do you currently, by any chance, support dilated stride in your convolution layers? Furthermore, are any types of activation functions supported (e.g. ReLu, leakyReLu, tanh, sigmoid, ...)?

    Thank you very much for all the information! Am looking forward to hear the final release date.

    Best regards,

    Daniel

  • Hi Daniel,

    We do support Deconvolution layer (with some limitation listed in the user guide)  in the TIDL library and caffe import but the importing tensorflow model with Deconv is not supported.  

    Yes, we do support dilated stride in the convolution layers, also we have support for RelU and PRelU activation functions.

    The next TIDL release will be available on 19th of this month.

    Thanks,

    Praveen

  • Okay, nice. Now I have a good overview of TIDL's current capabilities.

    Thanks for your help and best regards,
    Daniel