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 - Model Optimizer errors (LeakyRelu)

Orlov__Philipp
Beginner
770 Views

Howdy.

Just trying to convert YOLOv3 model via OpenVINO R5 by following the official instructions (https://software.intel.com/en-us/articles/OpenVINO-Using-TensorFlow#converting-a-darknet-yolo-model). Windows 10 64-bit, Python 3.6.5.

>python c:\Intel\computer_vision_sdk\deployment_tools\model_optimizer\mo_tf.py --input_model frozen_darknet_yolov3_model.pb --tensorflow_use_custom_operations_config c:\Intel\computer_vision_sdk\deployment_tools\model_optimizer\extensions\front\tf\yolo_v3.json --input_shape [1,416,416,3] --data_type=FP32

This results in:

Model Optimizer version:        1.5.12.49d067a0
[ ERROR ]  List of operations that cannot be converted to IE IR:
[ ERROR ]      LeakyRelu (72)
[ ERROR ]          detector/darknet-53/Conv/LeakyRelu
[ ERROR ]          detector/darknet-53/Conv_1/LeakyRelu

...

[ ERROR ]  Part of the nodes was not translated to IE. Stopped.
 For more information please refer to Model Optimizer FAQ (<INSTALL_DIR>/deployment_tools/documentation/docs/MO_FAQ.html), question #24.

Somehow MO does produce the .bin file with weights/biases, but no .xml due to above error(s).

Any advice?

0 Kudos
6 Replies
Koubele__Jakub
Beginner
770 Views

Hi, 

I had the same problem, solved it by downgrading tensorflow from 1.13.1 to 1.12.0.

0 Kudos
Shubha_R_Intel
Employee
770 Views

Hi Jakob, glad you solved it. Jakob and Phillip please also refer to my answer to a previous post:

Hello. I recently ran Model Optimizer on a yolo_v3 (also tiny yolo) and successfully generated IR. Afterward I even ran inference_engine\samples\object_detection_demo_yolov3_async on the following video person-bicycle-car-detction.mp4 within

https://github.com/intel-iot-devkit/sample-videos
The object detection worked nicely !

Please use the following for documentation:
https://docs.openvinotoolkit.org/R5/_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_YOLO_From_Tensorflow.html
I actually didn't even bother with the optional step of git checkout fb9f543
I just grabbed the latest and everything worked fine.

Also for inspiration take a look at https://github.com/PINTO0309/OpenVINO-YoloV3.git
That repo was not made by Intel but by someone in the OpenVino community.

Please look into the resources I've posted here diligently and I assure you, you will get yolo working !

Let me add that the yolo*.json files under deployment_tools\model_optimizer\extensions\front\tf are not intended to be perfect. It is expected that you may have to modify them to suit your needs. For instance this line "entry_points": ["detector/yolo-v3/Reshape", "detector/yolo-v3/Reshape_4", "detector/yolo-v3/Reshape_8"] will very surely have to change if you are doing tiny yolo. How do you know what to put there ? Using Tensorboard or by dumping your model into a text file, you will search for "Reshape" and see what the correct hierarchical name is.

Thanks,

Shubha

 

0 Kudos
Orlov__Philipp
Beginner
770 Views

Hello Shubha,

Thanks for a swift response. As it turned out, it did not help.

It seems there's an issue related to the tensorflow (v 1.13) that gets installed by OpenVINO. 

Having these done, get the things going smoothly:

  1. pip3 install tensorflow==1.12.0 --upgrade
  2. git clone https://github.com/mystic123/tensorflow-yolo-v3.git
  3. cd tensorflow-yolo-v3
  4. wget https://pjreddie.com/media/files/yolov3.weights
  5. wget https://github.com/pjreddie/darknet/blob/master/data/coco.names
  6. python ./convert_weights_pb.py --data_format NHWC
  7. python c:\Intel\computer_vision_sdk\deployment_tools\model_optimizer\mo_tf.py --input_model frozen_darknet_yolov3_model.pb --tensorflow_use_custom_operations_config c:\Intel\computer_vision_sdk\deployment_tools\model_optimizer\extensions\front\tf\yolo_v3.json --input_shape=[1,416,416,3]

Thanks,

Philipp.

0 Kudos
Shubha_R_Intel
Employee
770 Views

Thank you Philipp for the detailed response. A bug has been filed on this issue ! Much thanks for diagnosing it and thank you for using OpenVino !

Shubha

0 Kudos
Hajime_K_Intel
Employee
770 Views

Hi Shubha,

Could I ask the status of the fix on the issue?

Regards,

koga

0 Kudos
Shubha_R_Intel
Employee
770 Views

Dear HAJIME K.

Well OpenVino 2019 R2 should come out in the July/August time-frame. Hopefully it should be fixed by then - no promises !

Thanks,

Shubha

0 Kudos
Reply