Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

have problem in tf.squeeze()

Zhou__Eric
Beginner
369 Views

HI.

I'm using InceptionV1 tensorflow model.

If I use the IR model transformed by InceptionV1 pre-train model with "InceptionV1/Logits/SpatialSqueeze", there is a RuntimeError.

Inception code :

spatial_squeeze = True
if spatial_squeeze:
    logits = tf.squeeze(logits, [1, 2], name='SpatialSqueeze')

Error:

File "ie_api.pyx", line 551, in openvino.inference_engine.ie_api.IEPlugin.load
  File "ie_api.pyx", line 561, in openvino.inference_engine.ie_api.IEPlugin.load
RuntimeError: Unsupported primitive of type: Squeeze name: InceptionV1/Logits/SpatialSqueeze

But if I don't use "InceptionV1/Logits/SpatialSqueeze", the result is correct.

I found tf.squeeze() equals reshape in OpenVINO on this page: https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_Supported_Frameworks_Layers.html

I am using Windows10, Inten(R) Core(TM) i3-7310 CPU@2.7Hz, OpenVINO 2019R2 SDK

Any assistance on this matter would be appreciated.

0 Kudos
1 Reply
Shubha_R_Intel
Employee
369 Views

Dear Eric:

While Squeeze is supported as a Tensorflow Layer within Model Optimizer (as your referenced document shows) SpatialSqueeze is not supported. In order to support SpatialSqueeze you'd have to build a custom layer. So, it is possible to get SpatialSqueeze supported but you'd have to build a custom layer to make it work.

 RuntimeError: Unsupported primitive of type: Squeeze name: InceptionV1/Logits/SpatialSqueeze

This slightly dated IDZ post explains how to build custom layers. Please re-direct the 2018 links to 2019 ones in the dldt github code which is referenced in the post.

Hope it helps,

Thanks,

Shubha

0 Kudos
Reply