From: 박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 Date: Tue, 22 Jan 2019 02:35:15 +0000 (+0900) Subject: [enco/caffe] Average Pooling with Non Square Kernel (#2892) X-Git-Tag: nncc_backup~936 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c6240dbe41b2ebe50a2c400e272c4ccee8ab3cc0;p=platform%2Fcore%2Fml%2Fnnfw.git [enco/caffe] Average Pooling with Non Square Kernel (#2892) This commit fixes a bug in Caffe frontend which results in incorrect results when there is an average pooling layer with non squre kernel. This commit also adds a related regression test. Signed-off-by: Jonghyun Park --- diff --git a/contrib/enco/frontend/caffe/src/Layer/Pooling.cpp b/contrib/enco/frontend/caffe/src/Layer/Pooling.cpp index 7241cb0..36220d8 100644 --- a/contrib/enco/frontend/caffe/src/Layer/Pooling.cpp +++ b/contrib/enco/frontend/caffe/src/Layer/Pooling.cpp @@ -107,8 +107,7 @@ void PoolingBuilder::build(const ::caffe::LayerParameter &layer, GraphBuilderCon op->divisor(coco::AvgPool2D::Divisor::Static); op->window()->height(spec.window_height()); - // TODO FIX THIS BUG AND ADD TEST - op->window()->width(spec.window_height()); + op->window()->width(spec.window_width()); op->stride()->vertical(spec.vertical_stride()); op->stride()->horizontal(spec.horizontal_stride()); diff --git a/contrib/enco/test/caffe/Regression_0000/INFERENCE b/contrib/enco/test/caffe/Regression_0000/INFERENCE new file mode 100644 index 0000000..e69de29 diff --git a/contrib/enco/test/caffe/Regression_0000/test.prototxt b/contrib/enco/test/caffe/Regression_0000/test.prototxt new file mode 100644 index 0000000..5927d69 --- /dev/null +++ b/contrib/enco/test/caffe/Regression_0000/test.prototxt @@ -0,0 +1,17 @@ +layer { + name: "data" + type: "Input" + top: "data" + input_param { shape: { dim: 1 dim: 3 dim: 15 dim: 15 } } +} +layer { + name: "pool" + type: "Pooling" + bottom: "data" + top: "pool" + pooling_param { + pool: AVE + kernel_h: 3 + kernel_w: 1 + } +}