Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.
6105 Discussions

How to convert a TensorFlow model that has custom layers

HA14
Beginner
439 Views

Referring to my previous question posted here "https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Exception-occurred-during-running-replacer-amp-quot-REPLACEMENT/m-p/1241062#M22100",

I do have a custom layer which is a partial convolution layer in Tensorflow, I couldn't find a the documentation where it explains how to implement Custom Layer for Tensorflow. 

Could anyone show me where I should look, or is there a useful example/tutorial that shows how to do it?

0 Kudos
4 Replies
Adli
Moderator
421 Views

Hi HA14,

 

Thank you for reaching out to us. We are currently investigating this issue and will get back to you as soon as possible.

 

Regards,

Adli


Adli
Moderator
410 Views

Hi HA14,

 

Thank you for your patience. Only one method available to implement custom layers for Tensorflow models. Please refer to the following link.

https://docs.openvinotoolkit.org/latest/openvino_docs_HOWTO_Custom_Layers_Guide.html

The article also provides an example of the "Hybrid-CS-Model-MRI" TF model with 3 unsupported operations.

 

Additionally, here's the link for custom layer implementation in Model Optimizer - https://docs.openvinotoolkit.org/latest/openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer.html

 

Regards,

Adli


HA14
Beginner
381 Views

Thanks for your reply @Adli , I'm sorry I couldn't reply everyday as I was working on different topic too.

Now the thing is that I didn't even get the error that tells me the "List of operations that cannot be converted to Inference Engine IR" like the one in the Guide. I'm getting the an input shape error as in my first issue/link I posted. 

One more question as I'm still trying to understand the guide, do I have to create a file/operation/extension for each layer and then create a Cmake file to build them all? 

On what basics/guidelines should I build these new operations, and are those written in the guide very specific to that case mentioned only?

 

Adli
Moderator
387 Views

Hi HA14,

 

This thread will no longer be monitored since we have provided a solution. If you need any additional information from Intel, please submit a new question.

 

Regards,

Adli


Reply