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.

Yolov3 conversion error

zhernovoy__sergey
1,113 Views
Hi,  I am trying to convert yolov3 to IR using the method describer in the doc. All I need is to make image size bigger than default i.e. 832 1. I took original files coco.names and yolov3.weights 2. Converted them to .pb model using the following command  python3 convert_weights_pb.py --class_names coco.names --data_format NHWC --weights_file yolov3.weights --output_graph frozen_yolov3_model_832.pb --size 832 frozen_yolov3_model_832.pb file was created. 3. Attempt to convert it to IR using the following MO command python3 /opt/intel/computer_vision_sdk/deployment_tools/model_optimizer/mo_tf.py --input_model ~/models/frozen_yolov3_model_832.pb --tensorflow_use_custom_operations_config /opt/intel/computer_vision_sdk/deployment_tools/model_optimizer/extensions/front/tf/yolo_v3.json ​​​​​​​--input_shape [1,832,832,3] --output_dir ~/models/ --model_name yolo3_832 ended up with error: Model Optimizer arguments: Common parameters: - Path to the Input Model: /home/szh/models/frozen_yolov3_model_832.pb - Path for generated IR: /home/szh/models/ - IR output name: yolo3_832 - 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,832,832,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 - 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: /opt/intel/computer_vision_sdk/deployment_tools/model_optimizer/extensions/front/tf/yolo_v3.json Model Optimizer version: 1.5.12.49d067a0 [ ERROR ] Cannot infer shapes or values for node "detector/darknet-53/Conv/LeakyRelu". [ ERROR ] Op type not registered 'LeakyRelu' in binary running on szh-vino. Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (e.g.) `tf.contrib.resampler` should be done before importing the graph, as contrib ops are lazily registered when the module is first accessed. [ ERROR ] [ ERROR ] It can happen due to bug in custom shape infer function . [ 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 ] Stopped shape/value propagation at "detector/darknet-53/Conv/LeakyRelu" node. Could you please to find out what went wrong?
0 Kudos
8 Replies
zhernovoy__sergey
1,113 Views

Fixed, that was the wrong TF version

Please disregard, sorry

0 Kudos
Drakopoulos__Fotis
1,113 Views

Hello Sergey,

I'm having the same error. Could you tell me how you fixed this?

0 Kudos
zhernovoy__sergey
1,113 Views

Hi Fotis,

in my case the mistake was to run convert_weights_pb.py  on other machine than where the OpenVINO is installed. 

The solution is to do all such transformations on the OpenVINO machine where all components have the correct versions and configurations. 

So now I have a yolo3 with image size = 832 which was critical for me 

0 Kudos
Drakopoulos__Fotis
1,113 Views

zhernovoy, sergey wrote:

Hi Fotis,

in my case the mistake was to run convert_weights_pb.py  on other machine than where the OpenVINO is installed. 

The solution is to do all such transformations on the OpenVINO machine where all components have the correct versions and configurations. 

So now I have a yolo3 with image size = 832 which was critical for me 

So what are the correct versions? Because I think that some modules were updated on my machine and now I get that error.

0 Kudos
zhernovoy__sergey
1,113 Views

on my OpenVINO machine (Ubuntu 16.04 fresh install) it looks :

szh@szh-vino:~/yolo$ python3
Python 3.5.2 (default, Nov 12 2018, 13:43:14)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.__version__
'1.12.0'
>>>

 

0 Kudos
Drakopoulos__Fotis
1,113 Views

zhernovoy, sergey wrote:

on my OpenVINO machine (Ubuntu 16.04 fresh install) it looks :

szh@szh-vino:~/yolo$ python3
Python 3.5.2 (default, Nov 12 2018, 13:43:14)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.__version__
'1.12.0'
>>>

 

In my case it looks like this:

Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
tf>>> tf.__version__
'1.12.0'
>>>

I don't know what's causing the error...

0 Kudos
zhernovoy__sergey
1,113 Views

Frankly I don't know, my experience with the subject is about zero (3 days). I would start from fresh VM with just OpenVINO installed to make sure that the model conversion goes w/o errors. It was written that fresh OS is recommended because of possible conflicts with other previously installed packages 

0 Kudos
Lee__Terry
Beginner
1,113 Views

Hello Sergey,

It's good to hear that you have yolo3 working. What yolo3 mode are you using ? Is the detection looks normal? Did you try NCS2 ?

I'm having detection quality issue with yolo3 tiny using NCS2.

Thanks, Terry

0 Kudos
Reply