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

Bug report in converting custom yolov3 to IR


Hi there,

I halved the number of filters in yolov3.cfg and train a new model. I managed to convert yolov3_custom.weights into frozen_yolov3_custom.pb as documented in the following link:

Now when I am trying to convert from *.pb to *.xml and *.bin using following command I am getting this error: (following the similar topics in the forums I tested with tf versions: 1.12.0 and 1.14.0)

python3 --input_model frozen_darknet_yolov3_person_model.pb --tensorflow_use_custom_operations_config yolo_v3_person.json --output_dir ./ --model_name yolov3-person-fp32 --data_type FP32 --input_shape [1,416,416,3]
Model Optimizer arguments:
Common parameters:
    - Path to the Input Model:     frozen_darknet_yolov3_person_model.pb
    - Path for generated IR:     ./
    - IR output name:     yolov3-person-fp32
    - 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:     [1,416,416,3]
    - Mean values:     Not specified
    - Scale values:     Not specified
    - Scale factor:     Not specified
    - Precision of IR:     FP32
    - 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
    - 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:     yolo_v3_person.json
Model Optimizer version:     2019.1.1-83-g28dfbfd
/opt/intel/openvino_2019.1.144/deployment_tools/model_optimizer/mo/middle/passes/fusing/ RuntimeWarning: invalid value encountered in sqrt
  scale = 1. / np.sqrt(variance.value + eps)
[ ERROR ]  -------------------------------------------------
[ ERROR ]  ----------------- INTERNAL ERROR ----------------
[ ERROR ]  Unexpected exception happened.
[ ERROR ]  Please contact Model Optimizer developers and forward the following information:
[ ERROR ]  
[ ERROR ]  Traceback (most recent call last):
  File "/opt/intel/openvino_2019.1.144/deployment_tools/model_optimizer/mo/", line 312, in main
    return driver(argv)
  File "/opt/intel/openvino_2019.1.144/deployment_tools/model_optimizer/mo/", line 263, in driver
    is_binary=not argv.input_model_is_text)
  File "/opt/intel/openvino_2019.1.144/deployment_tools/model_optimizer/mo/pipeline/", line 141, in tf2nx
  File "/opt/intel/openvino_2019.1.144/deployment_tools/model_optimizer/mo/middle/passes/", line 186, in graph_clean_up_tf
    graph_clean_up(graph, ['TFCustomSubgraphCall', 'Shape'])
  File "/opt/intel/openvino_2019.1.144/deployment_tools/model_optimizer/mo/middle/passes/", line 181, in graph_clean_up
  File "/opt/intel/openvino_2019.1.144/deployment_tools/model_optimizer/mo/middle/passes/", line 145, in add_constant_operations
    Const(graph, dict(value=node.value, shape=np.array(node.value.shape))).create_node_with_data(data_nodes=node)
  File "/opt/intel/openvino_2019.1.144/deployment_tools/model_optimizer/mo/ops/", line 207, in create_node_with_data
    [np.array_equal(old_data_value[id], data_node.value) for id, data_node in enumerate(data_nodes)])

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


0 Kudos
1 Reply

Dear Abdollahi Aghdam, Omid,

So if I understand you correctly, you're experiencing a Model Optimizer failure on a custom-trained yolo v3 model ? In other words, you are not using the pre-trained one ?

Well today we just released OpenVino R2. Can you download it and try again ? R2 contains lots of new features and bug fixes.

Thanks for your patience. Definitely report back here on the status of OpenVino R2.




0 Kudos