Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
121 Views

Problem in convert custom yolov3-tiny model to IR

Hi

I prepared my own yolov3-tiny for use in raspberry pi 4 and NCS2.

and try to convert custom yolov3-tiny model to IR 

this is my step

1.  I try this command      " python convert_weights_pb.py --class_names obj.names --data_format NHWC --weights_file train.weights --tiny  "     I got  the file " frozen_darknet_yolov3_model.pb "

2. from my test.cfg file

[yolo]
mask = 3,4,5
anchors = 10,14,  23,27,  37,58,  81,82,  135,169,  344,319
classes=1
num=6
jitter=.3
ignore_thresh = .7
truth_thresh = 1
random=1

[route]
layers = -4

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[upsample]
stride=2

[route]
layers = -1, 8

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[convolutional]
size=1
stride=1
pad=1
filters=18
activation=linear

[yolo]
mask = 0,1,2
anchors = 10,14,  23,27,  37,58,  81,82,  135,169,  344,319
classes=1
num=6
jitter=.3
ignore_thresh = .7
truth_thresh = 1
random=1
 
so I edited yolo_v3_tiny.json  and rename to yolo_v3_tiny_mymodel.json
 
[
  {
    "id""TFYOLOV3",
    "match_kind""general",
    "custom_attributes": {
      "classes"1,
      "anchors": [1014232737588182135169344319],
      "coords"4,
      "num"6,
      "masks": [[345], [012]],
      "entry_points": ["detector/yolo-v3-tiny/Reshape""detector/yolo-v3-tiny/Reshape_4"]
    }
  }
]
 
3. I try next command   "  python mo_tf.py --input_model frozen_darknet_yolov3_model.pb --input_shape [1,416,416,3] --data_type FP16 --tensorflow_use_custom_operations_config yolo_v3_tiny_mymodel.json   "
 
I got this error
 
(TF114CV41) D:\ML\tensorflow-yolo-v3-master>python mo_tf.py --input_model frozen_darknet_yolov3_model.pb --input_shape [1,416,416,3] --data_type FP16 --tensorflow_use_custom_operations_config yolo_v3_tiny_mymodel.json
Model Optimizer arguments:
Common parameters:
- Path to the Input Model: D:\ML\tensorflow-yolo-v3-master\frozen_darknet_yolov3_model.pb
- Path for generated IR: D:\ML\tensorflow-yolo-v3-master\.
- IR output name: frozen_darknet_yolov3_model
- 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: 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
- 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: D:\ML\tensorflow-yolo-v3-master\yolo_v3_tiny_mymodel.json
Model Optimizer version: 2019.3.0-408-gac8584cb7
[ ERROR ] 2 elements of 16 were clipped to infinity while converting a blob for node [['detector/yolo-v3-tiny/Conv/BatchNorm/beta/read/Output_0/Data__const']] to <class 'numpy.float16'>.
For more information please refer to Model Optimizer FAQ (https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_Model_Optimizer_FAQ.html), question #76.
[ ERROR ] List of operations that cannot be converted to Inference Engine IR:
[ ERROR ] FusedBatchNormV3 (11)
[ ERROR ] detector/yolo-v3-tiny/Conv/BatchNorm/FusedBatchNormV3
[ ERROR ] detector/yolo-v3-tiny/Conv_1/BatchNorm/FusedBatchNormV3
[ ERROR ] detector/yolo-v3-tiny/Conv_2/BatchNorm/FusedBatchNormV3
[ ERROR ] detector/yolo-v3-tiny/Conv_3/BatchNorm/FusedBatchNormV3
[ ERROR ] detector/yolo-v3-tiny/Conv_4/BatchNorm/FusedBatchNormV3
[ ERROR ] detector/yolo-v3-tiny/Conv_5/BatchNorm/FusedBatchNormV3
[ ERROR ] detector/yolo-v3-tiny/Conv_6/BatchNorm/FusedBatchNormV3
[ ERROR ] detector/yolo-v3-tiny/Conv_7/BatchNorm/FusedBatchNormV3
[ ERROR ] detector/yolo-v3-tiny/Conv_10/BatchNorm/FusedBatchNormV3
[ ERROR ] detector/yolo-v3-tiny/Conv_11/BatchNorm/FusedBatchNormV3
[ ERROR ] detector/yolo-v3-tiny/Conv_8/BatchNorm/FusedBatchNormV3
[ ERROR ] Part of the nodes was not converted to IR. Stopped.
For more information please refer to Model Optimizer FAQ (https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_Model_Optimizer_FAQ.html), question #24.
 
please tell me how to solve this problem. I have attached my model in this post.
0 Kudos
2 Replies
Highlighted
Employee
96 Views

Hi teeradet,

Thanks for reaching out. Could you please try converting your model using the latest version of OpenVINO™ toolkit (2020.4)?

Let us know if the issue persists.

Regards,

David C


0 Kudos
Highlighted
Employee
85 Views

Hi teeradet,

This thread will no longer be monitored, as we got no response from you. If you have additional questions, please create a new discussion and we will help you there.

Regards,

David C.



0 Kudos