1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

Merge pull request #21025 from alalek:issue_21004

* dnn(ocl4dnn): fix LRN layer accuracy problems

- FP16 intermediate computation is not accurate and may provide NaN values

* dnn(test): update tolerance for FP16
This commit is contained in:
Alexander Alekhin
2021-11-12 01:54:07 +03:00
committed by GitHub
parent cb286a66be
commit 8041ab8a61
2 changed files with 14 additions and 13 deletions
+1 -1
View File
@@ -198,7 +198,7 @@ TEST_P(Reproducibility_AlexNet, Accuracy)
ASSERT_EQ(inLayerShapes[0][3], 227);
const float l1 = 1e-5;
const float lInf = (targetId == DNN_TARGET_OPENCL_FP16) ? 3e-3 : 1e-4;
const float lInf = (targetId == DNN_TARGET_OPENCL_FP16) ? 4e-3 : 1e-4;
net.setPreferableBackend(DNN_BACKEND_OPENCV);
net.setPreferableTarget(targetId);