Hi,
I have some issues converting darknet yolov3-tiny to Huawei Compatible(*.om) format.
What has been done so far is briefly described below:
1) According to darknet2caffe github repo (https://github.com/ChenYingpeng/darknet2caffe), model was successfully converted to caffe model,
2) According to CANN/Modifying YOLOv3 Prototxt (https://support.huaweicloud.com/intl/en-us/atctool-cann502alphaXinfer/atlasatc_16_0104.html), yolov3-tiny.prototxt file was modified. But the steps in this link are not directly applied due to yolov3 model whic have 3 yolo layer and 9 anchor boxes.
3) According to CANN Caffe Operator Specification List (https://support.huawei.com/enterprise/en/doc/EDOC1100191926?idPath=23710424|251366513|22892968|251168373), yolov3-tiny.prototxt file was modified. Because yolov3-tiny have 2 yolo layer and 6 anchor boxes.
That's why I added the yolo layer information to the end of our prototxt file as shown below;
layer {
bottom: "layer16-conv"
top: "yolo1_coords"
top: "yolo1_obj"
top: "yolo1_classes"
name: "yolo1"
type: "Yolo"
yolo_param {
boxes: 3
coords: 4
classes: 1
yolo_version: "V3"
softmax: true
background: false
}
}
layer {
bottom: "layer23-conv"
top: "yolo2_coords"
top: "yolo2_obj"
top: "yolo2_classes"
name: "yolo2"
type: "Yolo"
yolo_param {
boxes: 3
coords: 4
classes: 1
yolo_version: "V3"
softmax: true
background: false
}
}
layer {
name: "detection_out3"
type: "YoloV3DetectionOutput"
bottom: "yolo1_coords"
bottom: "yolo2_coords"
bottom: "yolo1_obj"
bottom: "yolo2_obj"
bottom: "yolo1_classes"
bottom: "yolo2_classes"
bottom: "img_info"
top: "box_out"
top: "box_out_num"
yolov3_detection_output_param {
boxes: 3
classes: 1
relative: true
obj_threshold: 0.5
score_threshold: 0.5
iou_threshold: 0.45
pre_nms_topn: 256
post_nms_topn: 512
biases_high: 10
biases_high: 14
biases_high: 23
biases_high: 27
biases_high: 37
biases_high: 58
biases_low: 81
biases_low: 82
biases_low: 135
biases_low: 169
biases_low: 344
biases_low: 319
}
}
4) Acording to pyacl_samples/acl_yolov3_caffe gitee repo (https://gitee.com/tianyu__zhou/pyacl_samples/tree/a800/acl_yolov3_caffe), The model was successfully converted from caffe to .om format using ATC tool,
5) Finally, Acording to pyacl_samples/acl_yolov3_caffe gitee repo, inferenc was done and everything looked so good but after the converting process, detection performance of the model decreased a lot. So, The model that provides 9/10 image detection on darknet, provides 4/10 image detection on .om format.
So, what can I do at this stage? Can you help me for this issue?
If you have any idea to figure it out this problem, I would be happy to hear.
Have a nice day.
Best,
Kubilay