- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page