1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge pull request #22840 from zihaomu:optimze_conv_memory_usage

DNN: reduce the memory used in convolution layer

* reduce the memory in winograd and disabel the test when usage memory is larger than 2gb.

* remove VERY_LOG tag
This commit is contained in:
Zihao Mu
2022-12-08 20:57:13 +08:00
committed by GitHub
parent ab912329b6
commit 0a650b573b
5 changed files with 105 additions and 92 deletions
+4 -1
View File
@@ -2112,8 +2112,11 @@ public:
int dilation_h = dilations[dilations.size() - 2];
int dilation_w = dilations.back();
// Winograd only works well on input h and w >12.
bool canUseWinograd = useWinograd && inputs[0].size[2] >= 12 && inputs[0].size[3] >= 12;
fastConv2dImpl = initFastConv2d(ngroups, K, C, Hk, Wk, stride_w, stride_h, dilation_w,
dilation_h, pads_begin, pads_end, weightsMat, &biasvec[0], useWinograd);
dilation_h, pads_begin, pads_end, weightsMat, &biasvec[0], canUseWinograd);
}
if (fastConv2dImpl)