File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -67,13 +67,14 @@ class PoolingLayerImpl : public PoolingLayer
67
67
public:
68
68
PoolingLayerImpl (const LayerParams& params)
69
69
{
70
- type = MAX;
71
70
computeMaxIdx = true ;
72
71
globalPooling = false ;
72
+ stride = Size (1 , 1 );
73
73
74
- if (params.has (" pool" ))
74
+ if (params.has (" pool" ) || params.has (" kernel_size" ) ||
75
+ params.has (" kernel_w" ) || params.has (" kernel_h" ))
75
76
{
76
- String pool = params.get <String>(" pool" ).toLowerCase ();
77
+ String pool = params.get <String>(" pool" , " max " ).toLowerCase ();
77
78
if (pool == " max" )
78
79
type = MAX;
79
80
else if (pool == " ave" )
@@ -90,6 +91,8 @@ class PoolingLayerImpl : public PoolingLayer
90
91
type = ROI;
91
92
computeMaxIdx = false ;
92
93
}
94
+ else
95
+ CV_Error (Error::StsBadArg, " Cannot determine pooling type" );
93
96
setParamsFrom (params);
94
97
ceilMode = params.get <bool >(" ceil_mode" , true );
95
98
pooledSize.width = params.get <uint32_t >(" pooled_w" , 1 );
You can’t perform that action at this time.
0 commit comments