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

Failed to convert tensorflow model with negative input shape value

Wu__David
Beginner
1,068 Views

Hi,

I'm trying to convert a Keras model to OpenVINO format.

At first I used a tool to convert model to tensorflow then use mo_tf.py. But I got the following error:

[ ERROR ]  Shape [-1 64 64  3] is not fully defined for output 0 of "input_1". Use --input_shape with positive integers to override model input shapes.
[ ERROR ]  Cannot infer shapes or values for node "input_1".
[ ERROR ]  Not all output shapes were inferred or fully defined for node "input_1". 
 For more information please refer to Model Optimizer FAQ (<INSTALL_DIR>/deployment_tools/documentation/docs/MO_FAQ.html), question #40. 
[ ERROR ]  
[ ERROR ]  It can happen due to bug in custom shape infer function <function tf_placeholder_ext.<locals>.<lambda> at 0x7fdb614f9730>.
[ 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).

So I add --input_shape = "[1 64 64 3]" or "[64 64 3]" but got another error.

Could you please check the error? Or what tool you suggest to convert Keras?

The tool I use to convert keras to tensorflow and attached files are the models and log:

https://github.com/amir-abdi/keras_to_tensorflow

And the model:

https://github.com/shamangary/SSR-Net

 

Thanks.

David

0 Kudos
1 Solution
mahinlma
New Contributor I
1,068 Views

try

-b 1

 instead passing -input_shape

note:

-b / --batch : batch size 

 

View solution in original post

0 Kudos
1 Reply
mahinlma
New Contributor I
1,069 Views

try

-b 1

 instead passing -input_shape

note:

-b / --batch : batch size 

 

0 Kudos
Reply