mirror of
https://github.com/opencv/opencv.git
synced 2025-06-08 01:53:19 +08:00
dnn(test): tune FP16 test tolerance
This commit is contained in:
parent
8fc31ee9df
commit
c9bb92d58b
@ -2959,12 +2959,6 @@ TEST_P(Test_ONNX_layers, AttentionSingleHead) {
|
|||||||
TEST_P(Test_ONNX_nets, ViT_B_32) {
|
TEST_P(Test_ONNX_nets, ViT_B_32) {
|
||||||
applyTestTag(CV_TEST_TAG_LONG, CV_TEST_TAG_DEBUG_LONG);
|
applyTestTag(CV_TEST_TAG_LONG, CV_TEST_TAG_DEBUG_LONG);
|
||||||
|
|
||||||
if (backend == DNN_BACKEND_CUDA && target == DNN_TARGET_CUDA_FP16)
|
|
||||||
{
|
|
||||||
// does not pass test for now
|
|
||||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_CUDA_FP16);
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string model_path = _tf("models/vit_b_32.onnx", false);
|
const std::string model_path = _tf("models/vit_b_32.onnx", false);
|
||||||
|
|
||||||
auto net = readNet(model_path);
|
auto net = readNet(model_path);
|
||||||
@ -2981,7 +2975,20 @@ TEST_P(Test_ONNX_nets, ViT_B_32) {
|
|||||||
net.setInput(blob);
|
net.setInput(blob);
|
||||||
auto out = net.forward();
|
auto out = net.forward();
|
||||||
|
|
||||||
normAssert(ref, out, "ViTB_32", default_l1, default_lInf);
|
double l1 = default_l1;
|
||||||
|
double lInf = default_lInf;
|
||||||
|
if (target == DNN_TARGET_CUDA_FP16)
|
||||||
|
{
|
||||||
|
l1 = 0.01;
|
||||||
|
lInf = 0.05;
|
||||||
|
}
|
||||||
|
if (target == DNN_TARGET_OPENCL_FP16)
|
||||||
|
{
|
||||||
|
l1 = 0.008;
|
||||||
|
lInf = 0.04;
|
||||||
|
}
|
||||||
|
|
||||||
|
normAssert(ref, out, "ViTB_32", l1, lInf);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(Test_ONNX_nets, VitTrack) {
|
TEST_P(Test_ONNX_nets, VitTrack) {
|
||||||
|
Loading…
Reference in New Issue
Block a user