Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to run with python benchmark.py --cfg ./config/face_detection_yunet.yaml #281

Closed
ddwolf opened this issue Dec 23, 2024 · 6 comments
Closed
Labels
question It is not an issue but rather a user question

Comments

@ddwolf
Copy link

ddwolf commented Dec 23, 2024

Here is the output of the command

[xxx@fedora-riscv benchmark]$ python benchmark.py --cfg ./config/face_detection_yunet.yaml
Benchmarking ...
mean       median     min        input size   model
12.16      12.25      11.91      [160, 120]   YuNet with ['face_detection_yunet_2023mar.onnx']
11.73      11.83      11.22      [160, 120]   YuNet with ['face_detection_yunet_2023mar_int8.onnx']
[ERROR:[email protected]] global onnx_importer.cpp:1035 handleNode DNN/ONNX: ERROR during processing node with 3 inputs and 1 outputs: [DequantizeLinear]:(onnx_node!bbox_head.multi_level_kps.2.conv2.weight_quantized_node) from domain='ai.onnx'
Traceback (most recent call last):
  File "/home/xxx/repos/opencv_zoo/benchmark/benchmark.py", line 226, in <module>
    model = model_handler(*model_path, **model_config)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/xxx/repos/opencv_zoo/models/face_detection_yunet/yunet.py", line 22, in __init__
    self._model = cv.FaceDetectorYN.create(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^
cv2.error: OpenCV(4.10.0) /tmp/pip-install-uvko15ge/opencv-python_5d2ac5030ab94a15b5dcfd252013fa45/opencv/modules/dnn/src/onnx/onnx_importer.cpp:1057: error: (-2:Unspecified error) in function 'handleNode'
> Node [[email protected]]:(onnx_node!bbox_head.multi_level_kps.2.conv2.weight_quantized_node) parse error: OpenCV(4.10.0) /tmp/pip-install-uvko15ge/opencv-python_5d2ac5030ab94a15b5dcfd252013fa45/opencv/modules/dnn/src/int8layers/quantization_utils.cpp:18: error: (-215:Assertion failed) axis >= 0 && targetShape.size() > axis && data.total() == targetShape[axis] in function 'broadcast1D2TargetMat'
>
@fengyuentau
Copy link
Member

cv2.error: OpenCV(4.10.0)

Hello @ddwolf , OpenCV 4.x does not support block quantized models, which are models with suffix int8bq. If you stick with 4.x, you could use filters run others without block quantized models, e.g. python3 benchmark.py --fp32 --int8.

@fengyuentau fengyuentau added the question It is not an issue but rather a user question label Dec 30, 2024
@ddwolf
Copy link
Author

ddwolf commented Dec 30, 2024

cv2.error: OpenCV(4.10.0)

Hello @ddwolf , OpenCV 4.x does not support block quantized models, which are models with suffix int8bq. If you stick with 4.x, you could use filters run others without block quantized models, e.g. python3 benchmark.py --fp32 --int8.

Thanks for your reply

Using your comand python3 benchmark.py --fp32 --int8 failed, suggested me to use --all

Finally I use this command, seems right.
python3 benchmark.py --model_exclude int8bq --all

After dozens of cases, it complains module cv2 has no attribute wechat_qrcode_WeChatQRCode
image

@ddwolf
Copy link
Author

ddwolf commented Dec 30, 2024

image

By the way, could you please tell me, among the three numbers: mean, median, min, what number do you use to fill into this image?

image

@fengyuentau
Copy link
Member

After dozens of cases, it complains module cv2 has no attribute wechat_qrcode_WeChatQRCode

It is in opencv-contrib-python, you can either exclude it or install the package along with opencv-python.

@fengyuentau
Copy link
Member

By the way, could you please tell me, among the three numbers: mean, median, min, what number do you use to fill into this image?

We have https://github.com/fengyuentau/opencv_zoo/blob/main/benchmark/generate_table.py to parse data in benchmark/README.md. So just put data following the same pattern in readme, make items in benchmark/table_config.yaml with the same pattern, and call generate_table.py.

@ddwolf
Copy link
Author

ddwolf commented Dec 31, 2024

Thank you so much, @fengyuentau, issue solved.

@ddwolf ddwolf closed this as completed Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question It is not an issue but rather a user question
Projects
None yet
Development

No branches or pull requests

2 participants