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.
6404 Discussions

Accuracy Checker reshape error in yolov5

Ashwin_J_S
New Contributor I
18,822 Views

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 Kudos
1 Solution
Ashwin_J_S
New Contributor I
17,612 Views

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.

View solution in original post

32 Replies
Wan_Intel
Moderator
3,448 Views

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


0 Kudos
Ashwin_J_S
New Contributor I
3,442 Views

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

0 Kudos
Wan_Intel
Moderator
3,441 Views

Hi Ashwin_J_S,

Noted with thanks.

 

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

 

 

Regards,

Wan


0 Kudos
Ashwin_J_S
New Contributor I
3,437 Views

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
0 Kudos
Wan_Intel
Moderator
3,435 Views

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


0 Kudos
Wan_Intel
Moderator
3,415 Views

Hi Ashwin_J_S,

 

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

 

 

Regards,

Wan


0 Kudos
Ashwin_J_S
New Contributor I
3,404 Views

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

 

benchmark_app -m last.xml -niter 100 
0 Kudos
Wan_Intel
Moderator
3,400 Views

Hi Ashwin_J_S,

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

 

 

Regards,

Wan


0 Kudos
Ashwin_J_S
New Contributor I
3,394 Views

Yeah sure  @Wan_Intel ,

accuracy_check -m last.xml -c acc.yaml 

 

0 Kudos
Wan_Intel
Moderator
3,386 Views

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

 

0 Kudos
Ashwin_J_S
New Contributor I
17,613 Views

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
Moderator
3,461 Views

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

 

0 Kudos
Reply