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

Use mo_tf.py Convert Tensorflow .pb model failed

CHEN__Yan
Beginner
1,217 Views

Help! I made/modified a MTCNN model, and it works well with tensordflow.

But now I try to convert it to NCS model with optimizer, the output is that:

Model Optimizer arguments:
Common parameters:
    - Path to the Input Model:     /home/dreaminsun/NCS/models/xmtcnn/input/xmtcnn_1_2_0.pb
    - Path for generated IR:     /home/dreaminsun/NCS/models/xmtcnn/output/FP16
    - IR output name:     xmtcnn_1_2_0
    - Log level:     ERROR
    - Batch:     Not specified, inherited from the model
    - Input layers:     Not specified, inherited from the model
    - Output layers:     Not specified, inherited from the model
    - Input shapes:     Not specified, inherited from the model
    - Mean values:     Not specified
    - Scale values:     Not specified
    - Scale factor:     Not specified
    - Precision of IR:     FP16
    - Enable fusing:     True
    - Enable grouped convolutions fusing:     True
    - Move mean values to preprocess section:     False
    - Reverse input channels:     False
TensorFlow specific parameters:
    - Input model in text protobuf format:     False
    - Offload unsupported operations:     False
    - Path to model dump for TensorBoard:     None
    - List of shared libraries with TensorFlow custom layers implementation:     None
    - Update the configuration file with input/output node names:     None
    - Use configuration file used to generate the model with Object Detection API:     None
    - Operations to offload:     None
    - Patterns to offload:     None
    - Use the config file:     None
Model Optimizer version:     1.5.12.49d067a0
[ ERROR ]  Unexpected exception happened during extracting attributes for node rnet/cond/add_2.
Original exception message: operands could not be broadcast together with remapped shapes [original->remapped]: (0,) and requested shape (0,4)

 

So how can i walk around ?

 

0 Kudos
1 Solution
Shubha_R_Intel
Employee
1,217 Views

Dear CHEN, Yan,

Did you freeze your model ? If so, please do a --log_level DEBUG and attach the error part of the log to this ticket.  Please give me the exact mo_tf.py command which you used also. Meanwhile, if you wouldn't mind, please attach your frozen pb as a *.zip file to this ticket. If you would prefer I can PM you and you can send me the model privately. Please let me know your preferences in reply to this post.

Thanks,

Shubha

 

View solution in original post

0 Kudos
5 Replies
Shubha_R_Intel
Employee
1,218 Views

Dear CHEN, Yan,

Did you freeze your model ? If so, please do a --log_level DEBUG and attach the error part of the log to this ticket.  Please give me the exact mo_tf.py command which you used also. Meanwhile, if you wouldn't mind, please attach your frozen pb as a *.zip file to this ticket. If you would prefer I can PM you and you can send me the model privately. Please let me know your preferences in reply to this post.

Thanks,

Shubha

 

0 Kudos
CHEN__Yan
Beginner
1,217 Views

that model has freezed yet。

mo_tf.py command shows as follow:

python3 ~/intel/computer_vision_sdk_2018.5.445/deployment_tools/model_optimizer/mo_tf.py \
  --input_model "/home/dreaminsun/NCS/models/xmtcnn/input/xmtcnn_1_2_0.pb" \
  --output_dir "/home/dreaminsun/NCS/models/xmtcnn/output/FP16" \
  --data_type "FP16" \
  --input "input,min_size,thresholds,factor" --input_shape "[1080, 1920, 3],[1],[3],[1]"   

I try to add the input description, but gets the same failure. 

I will post the model tensorboard later.

tks for your reply !!

 

0 Kudos
CHEN__Yan
Beginner
1,217 Views

Shubha R. (Intel) wrote:

Dear CHEN, Yan,

Did you freeze your model ? If so, please do a --log_level DEBUG and attach the error part of the log to this ticket.  Please give me the exact mo_tf.py command which you used also. Meanwhile, if you wouldn't mind, please attach your frozen pb as a *.zip file to this ticket. If you would prefer I can PM you and you can send me the model privately. Please let me know your preferences in reply to this post.

Thanks,

Shubha

 

 

I've upload the zip file, and the convert script. is it enough to solve this problem?

0 Kudos
Shubha_R_Intel
Employee
1,217 Views

Dear CHEN, Yan,

Thanks for uploading your zip file. I will debug this shortly.

Thanks for your patience !

Shubha

0 Kudos
Shubha_R_Intel
Employee
1,217 Views

Dear CHEN, Yan,

I reproduced your error. However I found stack overflow article about numpy error . The exception you are seeing actually comes from numpy and Model Optimizer is just passing it along. In fact the numpy error is coming from site-packages\numpy\lib\stride_tricks.py .Does this offer any clues to you ? Please look at the original exception message coming from numpy:

Original exception message: operands could not be broadcast together with remapped shapes [original->remapped]: (0,) and requested shape (0,4)

Hope it helps. Please report back here should you have additional info.

Thanks,

Shubha

0 Kudos
Reply