opencv / opencv

Open Source Computer Vision Library
https://opencv.org
Apache License 2.0
76.67k stars 55.65k forks source link

Strange behaviour with OpenVINO and int64 custom layers #25533

Open alexlyulkov opened 1 month ago

alexlyulkov commented 1 month ago

System Information

OpenCV 5.x Ubuntu 22.04 OpenVINO 2024.0.0

Detailed description

Sometimes OpenVINO pipeline in OpenCV changes the type of the model's output tensor from int64 to int32.

OpenVINO supports int64 tensors, but it doesn't support int64 operations, so it converts all int64 internal tensors to int32. So the models with int64 inputs or outputs work fine, but with int32 real precision. However, when we use custom OpenCV layers in OpenVINO pipeline, the OpenVINO compiler changes the type of the model's output tensor from int64 to int32.

Steps to reproduce

Enable Test_ArgMax_Int.random test for OpenVINO backend

Issue submission checklist