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.
6401 Discussions

[ ERROR ] Exception occurred during running replacer "REPLACEMENT_ID" (<class 'extensions.load.tf.l

resh
Beginner
1,165 Views

error.png

 

Basically, I am trying to get IR for TF2 supported saved_model.pb and this actually throws this error, an anyone make me understand the cause for it?

0 Kudos
8 Replies
Wan_Intel
Moderator
1,127 Views

Hi Reshu Singh,

Thank you for reaching out to us.

 

I noticed that you are using OpenVINO™ 2020.3.

We regret to inform you that OpenVINO™ 2020.3 does not support the conversion of TensorFlow 2 models to IR. However, OpenVINO™ 2021.3 does support the conversion of TensorFlow 2 models to IR.

 

OpenVINO™ 2021.3 is available for download at the following page:

https://software.intel.com/content/www/us/en/develop/tools/openvino-toolkit/download.html

 

The steps to convert TensorFlow 2 models to IR is available at the following page:

https://docs.openvinotoolkit.org/2021.3/openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow.html#Convert_From_TF2X

 

Regards,

Wan

 

0 Kudos
resh
Beginner
1,108 Views

Hi @Wan_Intel !

 

I tried downloading 2021.3 version but in that not able to see model_optimizer in <INSTALL_DIR>/deployment_tools/model_optimizer

 

Here is the screenshot-

no_mo.png

0 Kudos
Wan_Intel
Moderator
1,080 Views

Hi Reshu Singh,

Thanks for your information.


The issue you encountered is not a common issue when installing OpenVINO™ 2021.3. However, we found that this issue happens when the user installs OpenVINO™ 2021.3 runtime package.


Please download OpenVINO™ 2021.3 at the following page:

https://software.intel.com/content/www/us/en/develop/tools/openvino-toolkit/download.html


Select the options of Operating System (OS), Distribution, Version Type, and Installer Type, a “Download” button will appear. Click on the Download button to download the OpenVINO™ Toolkit installer on your local machine.


Next, install OpenVINO™ 2021.3 by following the steps given in the installation guides:

https://docs.openvinotoolkit.org/2021.3/openvino_docs_install_guides_installing_openvino_linux.html


To verify OpenVINO™ 2021.3 is installed correctly on your local machine, please run demo scripts located in Get Started Guides:

https://docs.openvinotoolkit.org/2021.3/get_started_guides.html


For example, if you are using Linux OS, you can run the Image Classification Demo Scripts:

https://docs.openvinotoolkit.org/2021.3/openvino_docs_get_started_get_started_linux.html#image_classification_demo_script


Please get back to us should you face any difficulty in downloading and installing OpenVINO™ 2021.3.



Regards,

Wan


0 Kudos
resh
Beginner
1,070 Views

Hi @Wan_Intel !

 

I actually now am able to successfully download 2021.3 version but the error with my very basic model, the error is attached as

Can you help in identifying the issue?

C2021.3.png

My simple sequential model is here as -

def create_model():
model = tf.keras.models.Sequential([
keras.layers.Dense(512, activation='relu', input_shape=(784,)),
keras.layers.Dropout(0.2),
keras.layers.Dense(10)
])

model.compile(optimizer='adam',
loss=tf.losses.SparseCategoricalCrossentropy(from_logits=True),
metrics=[tf.metrics.SparseCategoricalAccuracy()])

return model
 
0 Kudos
resh
Beginner
1,054 Views

[ ERROR ] Cannot infer shapes or values for node "StatefulPartitionedCall/sequential/dense/MatMul".
[ ERROR ] MatMul input shapes are incorrect. COL_INDEX_DIMs are not equal. Node: StatefulPartitionedCall/sequential/dense/MatMul. Shapes: [array([ 1, 512, 784, 512]), array([ 1, 512, 784, 512])]
[ ERROR ]
[ ERROR ] It can happen due to bug in custom shape infer function <function MatMul.infer at 0x7f0862f54840>.
[ ERROR ] Or because the node inputs have incorrect values/shapes.
[ ERROR ] Or because input shapes are incorrect (embedded to the model or passed via --input_shape).
[ ERROR ] Run Model Optimizer with --log_level=DEBUG for more information.
[ ERROR ] Exception occurred during running replacer "REPLACEMENT_ID" (<class 'extensions.middle.PartialInfer.PartialInfer'>): Stopped shape/value propagation at "StatefulPartitionedCall/sequential/dense/MatMul" node.
For more information please refer to Model Optimizer FAQ, question #38. (https://docs.openvinotoolkit.org/latest/openvino_docs_MO_DG_prepare_model_Model_Optimizer_FAQ.html?question=38#question-38)

0 Kudos
Wan_Intel
Moderator
1,039 Views

Hi Reshu Singh,

 

I have compiled your sequential model and successfully converted the model to IR using the following model optimizer command:

python mo_tf.py --saved_model_dir <path_to_saved_model_dir> --input_shape [1,512,512,784]

 

General guidelines on specifying input shape is available at the following links:

https://docs.openvinotoolkit.org/2021.3/openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model_General.html

 

https://docs.openvinotoolkit.org/2021.3/openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model_General.html#when_to_specify_input_shapes

 

Regards,

Wan


0 Kudos
Wan_Intel
Moderator
1,015 Views

Hi Reshu Singh,


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,

Wan


0 Kudos
resh
Beginner
1,004 Views

Resolved! Thanks for helping out

0 Kudos
Reply