Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Gupta__Shubham
New Contributor I
70 Views

Tensorflow to IR conversion error with tf.gather

Jump to solution

Hi ,

I am using latest openvino 2021.2  and tensorflow 2.4.0 on my ubuntu 18.04 machine.

I am trying to convert my custom model from tensorflow to openvino IR but getting an error :

 

 


[ ERROR ] -------------------------------------------------
[ ERROR ] ----------------- INTERNAL ERROR ----------------
[ ERROR ] Unexpected exception happened.
[ ERROR ] Please contact Model Optimizer developers and forward the following information:
[ ERROR ] Power operation StatefulPartitionedCall/model/postprocess_layer/floordiv_2/Div/reciprocal_ has inputs of different data types: <class 'numpy.int32'> and float32
[ ERROR ] Traceback (most recent call last):
File "/opt/intel/openvino_2021.2.185/deployment_tools/model_optimizer/mo/main.py", line 297, in main
ret_code = driver(argv)
File "/opt/intel/openvino_2021.2.185/deployment_tools/model_optimizer/mo/main.py", line 264, in driver
ret_res = emit_ir(prepare_ir(argv), argv)
File "/opt/intel/openvino_2021.2.185/deployment_tools/model_optimizer/mo/main.py", line 248, in emit_ir
meta_info=get_meta_info(argv))
File "/opt/intel/openvino_2021.2.185/deployment_tools/model_optimizer/mo/pipeline/common.py", line 208, in prepare_emit_ir
type_infer(graph)
File "/opt/intel/openvino_2021.2.185/deployment_tools/model_optimizer/mo/middle/passes/infer.py", line 270, in type_infer
node_type_infer(node)
File "/opt/intel/openvino_2021.2.185/deployment_tools/model_optimizer/mo/middle/passes/infer.py", line 288, in node_type_infer
node.type_infer(node)
File "/opt/intel/openvino_2021.2.185/deployment_tools/model_optimizer/extensions/ops/elementwise.py", line 144, in type_infer
node.soft_get('name'), in_type_0, in_type_1)
AssertionError: Power operation StatefulPartitionedCall/model/postprocess_layer/floordiv_2/Div/reciprocal_ has inputs of different data types: <class 'numpy.int32'> and float32

[ ERROR ] ---------------- END OF BUG REPORT --------------
[ ERROR ] -------------------------------------------------

 

 

I am getting this error when using tf.gather in my model graph, without that model conversion is working fine.

 

i am attaching my tensorflow saved_model for reference.

Any help would be great.

Thanks

Shubham Gupta

0 Kudos

Accepted Solutions
Gupta__Shubham
New Contributor I
47 Views

It's solved! The problem was not with tf.gather, it was back tracing to floor "//" operation that i was doing. Model optimizer was not able to handle the data type conversion which tensorflow was handling automatically.

View solution in original post

5 Replies
Gupta__Shubham
New Contributor I
69 Views

Here is the model that I'm trying to convert

Gupta__Shubham
New Contributor I
57 Views

Also the command i used for conversion is:

python3 /opt/intel/openvino_2021/deployment_tools/model_optimizer/mo_tf.py --saved_model_dir prediction_model -o . --input_shape [1,512,512,3]

Gupta__Shubham
New Contributor I
48 Views

It's solved! The problem was not with tf.gather, it was back tracing to floor "//" operation that i was doing. Model optimizer was not able to handle the data type conversion which tensorflow was handling automatically.

View solution in original post

Iffa_Intel
Moderator
45 Views

Greetings,


Glad to know that you had found the solution & thanks for sharing it.

This might help others in case they have the same problem.


If you don't have any further inquiries, shall I close this thread?



Sincerely,

Iffa


Iffa_Intel
Moderator
40 Views

Greetings,


Intel will no longer monitor this thread since this issue has been resolved. If you need any additional information from Intel, please submit a new question.


Sincerely,

Iffa