mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 07:13:02 +04:00
Fallback for "SAME" padMode in ocl convolution and pooling
It fixes tensorflow ocl testcase of MobileNetSSD and Inception_v2_SSD Signed-off-by: Li Peng <peng.li@intel.com>
This commit is contained in:
@@ -824,15 +824,9 @@ public:
|
||||
for (int i = 0; i < inputs.size(); ++i)
|
||||
CV_Assert(inputs[i].u != outputs[0].u);
|
||||
|
||||
int inpH = inputs[0].size[2];
|
||||
int inpW = inputs[0].size[3];
|
||||
int out_h = (inpH + 2 * pad.height - (dilation.height * (kernel.height - 1) + 1)) / stride.height + 1;
|
||||
int out_w = (inpW + 2 * pad.width - (dilation.width * (kernel.width - 1) + 1)) / stride.width + 1;
|
||||
if (out_h != outputs[0].size[2] || out_w != outputs[0].size[3])
|
||||
if (padMode == "SAME")
|
||||
return false;
|
||||
|
||||
int group = inputs[0].size[1] / umat_blobs[0].size[1];
|
||||
|
||||
if (convolutionOp.empty())
|
||||
{
|
||||
OCL4DNNConvConfig config;
|
||||
@@ -842,7 +836,7 @@ public:
|
||||
config.pad = pad;
|
||||
config.stride = stride;
|
||||
config.dilation = dilation;
|
||||
config.group = group;
|
||||
config.group = inputs[0].size[1] / umat_blobs[0].size[1];
|
||||
config.bias_term = (hasBias()) ? true : false;
|
||||
|
||||
convolutionOp = Ptr<OCL4DNNConvSpatial<float> >(new OCL4DNNConvSpatial<float>(config));
|
||||
|
||||
Reference in New Issue
Block a user