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

Conversion of mxnet model (.params and .json) to a openvino IR (.xml and .bin) using model optimizer

Cronje__Abrie
Beginner
785 Views

I trained a custom object detection model (framework: MXNet) (base network: resnet-50) (training image: 811284229777.dkr.ecr.us-east-1.amazonaws.com/object-detection:latest) on AWS Sagemaker, resulting in a .params and .json file.

When I try to optimize it using the openvino model optimizer with the code below:

python3 mo.py
--input_model deploy_model_algo_1-0000.params
--output_dir openvino_models/ir/
--input_shape "[1,300,300,3]"

I get the following error

[ ERROR ]  Exception occurred during running replacer "REPLACEMENT_ID" (<class 'extensions.front.user_data_repack.UserDataRepack'>): Original placeholders: 'relu4_3_scale, data, conv1_1_weight, conv1_1_bias, conv1_2_weight, conv1_2_bias, conv2_1_weight, conv2_1_bias, conv2_2_weight, conv2_2_bias, conv3_1_weight, conv3_1_bias, conv3_2_weight, conv3_2_bias, conv3_3_weight, conv3_3_bias, conv4_1_weight, conv4_1_bias, conv4_2_weight, conv4_2_bias, conv4_3_weight, conv4_3_bias, relu4_3_cls_pred_conv_weight, relu4_3_cls_pred_conv_bias, conv5_1_weight, conv5_1_bias, conv5_2_weight, conv5_2_bias, conv5_3_weight, conv5_3_bias, fc6_weight, fc6_bias, fc7_weight, fc7_bias, relu7_cls_pred_conv_weight, relu7_cls_pred_conv_bias, relu4_3_loc_pred_conv_weight, relu4_3_loc_pred_conv_bias, relu7_loc_pred_conv_weight, relu7_loc_pred_conv_bias'. Freezing was requested for ''. --input_shape was provided without --input. Can not deduce which node shape to override

These 'placeholders' all refer to sections in the .json file where the 'op' field is null, for instance:
 

{
      "op": "null", 
      "name": "conv5_1_weight", 
      "attrs": {
        "kernel": "(3, 3)", 
        "num_filter": "512", 
        "pad": "(1, 1)"
      }, 
      "inputs": []
    },


When I do not specify the input shape, using the call below,

python3 mo.py
--input_model deploy_model_algo_1-0000.params
--output_dir openvino_models/ir/

I get the following error,

[ ERROR ]  Cannot infer shapes or values for node "relu7_loc_pred_conv_bias".
[ ERROR ]  Parameter node relu7_loc_pred_conv_bias should have `shape` attribute. Please use cli options to set model input shape
[ ERROR ]  
[ ERROR ]  It can happen due to bug in custom shape infer function <function Parameter.infer at 0x7fc65aa2ec20>.
[ 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 "relu7_loc_pred_conv_bias" node.
 For more information please refer to Model Optimizer FAQ (https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_Model_Optimizer_FAQ.html), question #38.

The suggested question 38 was not very helpful to me.

38. What does the message "Stopped shape/value propagation at node" mean?

Model Optimizer cannot infer shapes or values for the specified node. It can happen because of a bug in the custom shape infer function, because the node inputs have incorrect values/shapes, or because the input shapes are incorrect.

I am quite new to openvino and any help would be greatly appreciated.

0 Kudos
3 Replies
Munesh_Intel
Moderator
785 Views

 

Hi Abrie,

Would you please provide us the trained model files, together with .params and .json files, so that we can reproduce your issue?

Thank you.

 

Regards,

Munesh

0 Kudos
Martino__Evan
Beginner
785 Views

I'm having the same error converting RetinaFace, with the .json and .params files available at https://www.dropbox.com/s/53ftnlarhyrpkg2/retinaface-R50.zip?dl=0

Any help would be appreciated!

0 Kudos
Munesh_Intel
Moderator
785 Views

Hi Evan,

Greetings to you.

Please create a new thread to help us serve you better, since this thread is not monitored anymore..

Thank you.

 

Regards,

Munesh

0 Kudos
Reply