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
31,110 조회수

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,900 조회수

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,963 조회수

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 포인트
Ashwin_J_S
새로운 기여자 I
5,957 조회수

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

0 포인트
Wan_Intel
중재자
5,956 조회수

Hi Ashwin_J_S,

Noted with thanks.

 

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

 

 

Regards,

Wan


0 포인트
Ashwin_J_S
새로운 기여자 I
5,952 조회수

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 포인트
Wan_Intel
중재자
5,950 조회수

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 포인트
Wan_Intel
중재자
5,930 조회수

Hi Ashwin_J_S,

 

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

 

 

Regards,

Wan


0 포인트
Ashwin_J_S
새로운 기여자 I
5,919 조회수

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

 

benchmark_app -m last.xml -niter 100 
0 포인트
Wan_Intel
중재자
5,915 조회수

Hi Ashwin_J_S,

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

 

 

Regards,

Wan


0 포인트
Ashwin_J_S
새로운 기여자 I
5,909 조회수

Yeah sure  @Wan_Intel ,

accuracy_check -m last.xml -c acc.yaml 

 

0 포인트
Wan_Intel
중재자
5,901 조회수

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 포인트
Ashwin_J_S
새로운 기여자 I
29,901 조회수

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,976 조회수

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 포인트
응답