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.

Accuracy Checker reshape error in yolov5

Ashwin_J_S
新貢獻者 I
30,792 檢視

Hi, I have a custom trained yolov5 model, When i convert to fp32 and run accuracy checker on it i am facing a reshape error. to verify my configuration yaml file i have tried the same configuration file in pretrained yolov5 fp32 model and the accuracy checker works fine there . Is there anyways to merge two channels in openvino ?? Have attached the error screen grab

 

The yaml configuration file i used 

 

 

models:
  - name: yolo_v5
    launchers:
      - framework: dlsdk
        model: /home/nga_hitech_ib/yolov5_MBU/yolov5s.xml
        weights: /home/nga_hitech_ib/yolov5_MBU/yolov5s.bin
        device: CPU
        adapter:
          type: yolo_v5
          anchors: "10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326"
          num: 3
          coords: 4
          classes: 80
          threshold: 0.001
          anchor_masks: [[0, 1, 2], [3, 4, 5], [6, 7, 8]]
          raw_output: True
          outputs:
            - '345'
            - '404'
            - '463'
           


    datasets:
      - name: COCO2017_detection_80cl
        data_source: /home/nga_hitech_ib/model_test/coco_2017/val2017
        annotation_conversion:
            converter : mscoco_detection
            annotation_file: /home/nga_hitech_ib/model_test/coco_2017/instances_val2017.json
            images_dir: /home/nga_hitech_ib/model_test/coco_2017/val2017
            has_background: false
            use_full_label_map: false

        preprocessing:
          - type: resize
            size: 640
        postprocessing:
          - type: resize_prediction_boxes
          - type: filter
            apply_to: prediction
            min_confidence: 0.001
            remove_filtered: true
          - type: nms
            overlap: 0.5
          - type: clip_boxes
            apply_to: prediction
        metrics:
          - type: map
            integral: 11point
            ignore_difficult: true
            presenter: print_scalar
          - name: AP@0.5
            type: coco_precision
            max_detections: 100
            threshold: 0.5
          - name: AP@0.5:0.05:95
            type: coco_precision
            max_detections: 100
            threshold: '0.5:0.05:0.95'

 

 

 

0 積分
1 解決方案
Ashwin_J_S
新貢獻者 I
29,582 檢視

Hi, @Wan_Intel  

 

So I remembered I used only 4 classes , and changed 80 to 4 in the configuration file its working now, Thank you so much for help.

在原始文章中檢視解決方案

32 回應
Wan_Intel
主席
5,924 檢視

Hi Ashwin_J_S,

Thanks for your information.

 

I’ll share the information with next level for further investigation. Meanwhile, is it possible to share your custom model with us?

 

 

Regards,

Wan


Ashwin_J_S
新貢獻者 I
5,918 檢視

Thank you for the update @Wan_Intel , But as I mentioned before unfortunately I am prohibited to share the model with you. 

Wan_Intel
主席
5,917 檢視

Hi Ashwin_J_S,

Noted with thanks.

 

Could you please share the config file you used with the Accuracy Checker?

 

 

Regards,

Wan


Ashwin_J_S
新貢獻者 I
5,913 檢視

Sure @Wan_Intel ,

 

models:
  - name: yolo_v5
    launchers:
      - framework: dlsdk
        device: CPU
        adapter:
          type: yolo_v5
          anchors: "10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326"
          num: 3
          coords: 4
          classes: 80
          threshold: 0.001
          anchor_masks: [[0, 1, 2], [3, 4, 5], [6, 7, 8]]
          raw_output: True
          outputs:
            - '443'
            - '487'
            - '531'
            
            

    datasets:
      - name: small
        data_source: "/home/ubuntu/coco_2017/val2017/"
        annotation_conversion:
          converter: mscoco_detection
          annotation_file: "/home/ubuntu/coco_2017/annotations/instances_val2017.json"
          images_dir: "/home/ubuntu/coco_2017/val2017/"

        preprocessing:
          - type: resize
            size: 640

        postprocessing:
          - type: resize_prediction_boxes
          - type: filter
            apply_to: prediction
            min_confidence: 0.001
            remove_filtered: True
          - type: nms
            overlap: 0.5
          - type: clip_boxes
            apply_to: prediction

        metrics:
          - type: map
            integral: 11point
            ignore_difficult: true
            presenter: print_scalar
          - type: coco_precision
            max_detections: 100
            threshold: 0.5
Wan_Intel
主席
5,911 檢視

Hi Ashwin_J_S,

 

Could you please use anchor_masks: [[6, 7, 8], [3, 4, 5], [0, 1, 2]] in the config file and run Accuracy Checker again?

 

 

Regards,

Wan


Wan_Intel
主席
5,891 檢視

Hi Ashwin_J_S,

 

Are you able to use your custom model with Benchmark Python Tool?

 

 

Regards,

Wan


Ashwin_J_S
新貢獻者 I
5,880 檢視

Hi @Wan_Intel , Yes I am able to use the benchmark_app  with my custom model.

 

benchmark_app -m last.xml -niter 100 
Wan_Intel
主席
5,876 檢視

Hi Ashwin_J_S,

Could you share the command you use to run Accuracy Checker?

 

 

Regards,

Wan


Ashwin_J_S
新貢獻者 I
5,870 檢視

Yeah sure  @Wan_Intel ,

accuracy_check -m last.xml -c acc.yaml 

 

Wan_Intel
主席
5,862 檢視

Hi Ashwin_J_S,

@Ashwin_J_S 

 

I encountered the same error when I change the classes number.

 

May I know how many classes did you used to train the model?

 

 

Regards,

Wan

 

Ashwin_J_S
新貢獻者 I
29,583 檢視

Hi, @Wan_Intel  

 

So I remembered I used only 4 classes , and changed 80 to 4 in the configuration file its working now, Thank you so much for help.

Wan_Intel
主席
5,937 檢視

Hi Ashwin_J_S,

@Ashwin_J_S 

 

Great! We’re happy that you are now able to run your model with Accuracy Checker.

This thread will no longer be monitored since this issue has been resolved. 

If you need any additional information from Intel, please submit a new question.

 

 

Thanks, and best regards,

Wan

 

回覆